Results 1 to 6 of 6

Thread: Saving?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2003
    Posts
    91

    Saving?

    I want to make a program in which the button (btnSteal) would be clicked, and it would output txtName and txtPass on 2 different lines in a text file. How would I go about coding that button?

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    It seems by your post count that you are still new here, welcome. I think you'll get faster answers if you try searching the forums first before asking a question. A lot of times someone else has already asked the same question and then you don't have to post and wait for someone to respond. Of course if you don't find an answer or understand one then by all means post. I don't mean to discourage or offend you by this either, I'm only trying to help.

    Now having said all that you may find this post helpful:
    http://www.vbforums.com/showthread.p...hreadid=276061

    It shows how to save things to a text file.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2003
    Posts
    91
    i dont get it... i want it 2 take 2 text boxes and save them... i got it 2 save the file now, but its an empty file.. how do i tell it what 2 put in the file??

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    In the sample code posted in that thread it uses the line: sw.writeline(itm.ToString) to actually write a line in the text file. So what you want to do is put the information you want written there instead of item.ToString. For instance if I had a textbox named txtUser then I'd use: sw.Writeline(txtUser.Text)

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Dec 2003
    Posts
    91
    wha??? heres my code so far...
    VB Code:
    1. username = Me.txtName.Text
    2.         password = Me.txtPass.Text
    3.         Dim random As Integer = Rnd() * 9554574
    4.         Dim strFilename As String = "C:\" & username & random & ".txt"
    5.  
    6.         Dim testfile As New FileInfo(strFilename)
    7.         testfile.Create()
    8.         MessageBox.Show("Error in 0x00002102341.  Program will terminate." & vbCrLf & "If this problem persists, please restart your computer.")

  6. #6
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Synth3t1c
    wha??? heres my code so far...
    VB Code:
    1. username = Me.txtName.Text
    2.         password = Me.txtPass.Text
    3.         Dim random As Integer = Rnd() * 9554574
    4.         Dim strFilename As String = "C:\" & username & random & ".txt"
    5.  
    6.         Dim testfile As New FileInfo(strFilename)
    7.         testfile.Create()
    8.         MessageBox.Show("Error in 0x00002102341.  Program will terminate." & vbCrLf & "If this problem persists, please restart your computer.")
    you're not following what Edneeis told you. See the link he gave you and use that. SW.WriteLine( thingsThatYouWantToWriteToDaFile )
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width