Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am trying to create a new file that will temporarily store information from my text boxes.

 

Does somebody know the syntax to create a new file?

 

Thank you! Mindi Wright

  • *Experts*
Posted
'Create a file and write to it
       Dim f As IO.StreamWriter
       f = IO.File.CreateText(IO.Directory.GetParent( _
           Application.ExecutablePath).ToString & "\Temp.txt")

       f.Write("blah")
       f.Close()

Posted

Do you know how I can change the directory?

 

This worked, it created it in my visual studio projects/test/bin folder. But do you know how I can change this? I tried to add a different path before the \temp.txt, but that didn't work for me.

 

I really appreciate your help!

  • *Experts*
Posted

Change the Application.ExecutablePath).ToString & "\Temp.txt") bit

to something else, like 'C:\stuff\Temp.txt'. You can give it a relative

path like I did, or an absolute path.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...