Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 86,383 VB.NET Programmers. There are 1,383 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a VB.NET Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

Digital Memory Box

 
Reply to this topicStart new topic

Digital Memory Box, Digital Memory Box

citricube
post 11 Mar, 2008 - 12:21 PM
Post #1


New D.I.C Head

*
Joined: 21 Jan, 2008
Posts: 21



Hey I came up with an idea for a program that you save memories with and then there they are called back in a random order I know how to use streamreader and writer but not how to make seperated sections in a text file that are retrieved
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


PsychoCoder
post 11 Mar, 2008 - 12:25 PM
Post #2


ToCode || !ToCode

Group Icon
Joined: 26 Jul, 2007
Posts: 5,858

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: code.gif

Thanks smile.gif

Also, since you said you were using a StreamReader & StreamWriter I'm moving this to the VB.Net Forum smile.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

citricube
post 11 Mar, 2008 - 12:27 PM
Post #3


New D.I.C Head

*
Joined: 21 Jan, 2008
Posts: 21

Ight Man Here
CODE

Public Class Form1
    Dim a
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    
        If a = 1 Then


            My.Computer.FileSystem.WriteAllText _
            ("memory.mem", _
             "Made With Digital Memory Box" & vbNewLine & "----------------" & vbNewLine & TB1.Text, True)
            a = 0

        Else

            My.Computer.FileSystem.WriteAllText _
            ("memory.mem", _
             vbNewLine & "----------------" & vbNewLine & TB1.Text, True)
        End If


    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try

            Dim fileReader As String
            fileReader = My.Computer.FileSystem.ReadAllText("memory.mem")





        Catch

            a = 1
        End Try
    End Sub
End Class


QUOTE(PsychoCoder @ 11 Mar, 2008 - 12:25 PM) *

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: code.gif

Thanks smile.gif

Also, since you said you were using a StreamReader & StreamWriter I'm moving this to the VB.Net Forum smile.gif


This post has been edited by citricube: 11 Mar, 2008 - 12:34 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

citricube
post 15 Apr, 2008 - 01:17 PM
Post #4


New D.I.C Head

*
Joined: 21 Jan, 2008
Posts: 21

ph34r.gif never mind i got it all figured out thanks for NOT helping ~ just playin blink.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

PsychoCoder
post 15 Apr, 2008 - 01:27 PM
Post #5


ToCode || !ToCode

Group Icon
Joined: 26 Jul, 2007
Posts: 5,858

Sir, don't be upset, we're not just going to start writing source code for you when you haven't shown that you've even attempted a solution. We are here to help, thats what we do. We aren't here to write code for everyone who comes in looking for it. I'm sorry is that offended you, as it wasn't intended to.

Had you shows your code in your original post I would have bent over backwards to try and help you with it smile.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

citricube
post 7 May, 2008 - 01:32 PM
Post #6


New D.I.C Head

*
Joined: 21 Jan, 2008
Posts: 21


biggrin.gif I was just jokin i completed my digital memory box too


"Memory Writer"
CODE

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Dim savem As New System.IO.StreamWriter("memory.mem", True)
            savem.Write(TB1.Text & vbCrLf)
            savem.Close()
            TB1.Text = ""
        Catch
        End Try
    End Sub
End Class







"Memory Viewer"
CODE

Public Class BoxRead

    Dim bla = 0
    Dim uppa, lowa
    Dim memz(9999) As String
    Dim txt
    Dim lastRandomMemory
    Dim RandomMemory
    Dim fileReader As String
    Public Function goo(ByVal Low As Long, _
               ByVal High As Long) As Long
        goo = Int((High - Low + 1) * Rnd()) + Low
    End Function
    Private Sub BoxRead_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            fileReader = My.Computer.FileSystem.ReadAllText("memory.mem")
        Catch
            MsgBox("No Memories Saved Yet :-(")
            End
        End Try
        Randomize()
        Dim v = Split(fileReader, vbCrLf)
        uppa = UBound(v, 1) - 1
        lowa = LBound(v, 1)
        For n = LBound(v, 1) To UBound(v, 1)
            txt = Trim$(v(n))
            If Len(txt) > 0 Then memz(n) = txt
        Next n
        TextBox1.Text = memz(bla)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        bla = bla + 1
        Try

            If bla > uppa Then
                bla = bla - 1
            Else
                TextBox1.Text = memz(bla)
            End If
        Catch
            bla = bla - 1
        End Try
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        bla = bla - 1
        Try
            TextBox1.Text = memz(bla)
        Catch
            bla = bla + 1
        End Try
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Start:
        RandomMemory = goo(lowa, uppa)
        If RandomMemory = lastRandomMemory Then
            GoTo Start
        Else
            TextBox1.Text = memz(RandomMemory)
        End If

        lastRandomMemory = RandomMemory
        bla = RandomMemory
    End Sub
End Class
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/17/08 03:51AM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month