Results 1 to 1 of 1

Thread: Writing text to a file... <RESOLVED>

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2004
    Posts
    53

    Writing text to a file... <RESOLVED>

    All I wanted to do was write a username and password to a simple .txt file when the user pushed a 'register' button. I tried having the file located in its own directory, it didn't work so when I moved it to the same directory as the rest of the application, still nothing so I tried the /bin folder and still nothing. I get no errors with the following code, it just simply won't write to the file.

    VB Code:
    1. Dim objIStor As IsolatedStorage.IsolatedStorageFileStream
    2.             Dim objSW As StreamWriter
    3.             Dim _user, _pass As String
    4.  
    5.             'Open file to write
    6.             _user = txtUser.Text
    7.             _pass = txtPass.Text
    8.  
    9.             objIStor = New IsolatedStorage.IsolatedStorageFileStream("login.txt", FileMode.OpenOrCreate)
    10.             objSW = New StreamWriter(objIStor)
    11.             objSW.WriteLine(_user)
    12.             objSW.WriteLine(_pass)
    13.             objSW.Close()

    I don't understand why it won't write to the file

    EDIT: Figured it out thanks =) Had to go and turn on simple file sharing in folder options so I could change the security settings to let ASPNET user change stuff in the folder.
    Last edited by Dewwd; Apr 19th, 2005 at 05:28 PM.

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