|
-
Aug 30th, 2003, 02:26 AM
#1
Thread Starter
Junior Member
Save File Dialog question
Hello everyone, I tried to save some order input to a text file. The saved text file doesn't show the information, just a blank text file. Below is a piece of code that I wrote. Please adivise what need to be corrected. Thanks a lot guys.
-------------------------------------------------------------------------------
Private Sub mnuExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuExport.Click
'Save the sample text to a file.
Dim filenum As Integer
Dim xyz As New frmOrder()
Dim i As Integer
'Separate the path from the location
i = System.Reflection.Assembly.GetExecutingAssembly.Location.Length
While Mid(System.Reflection.Assembly.GetExecutingAssembly.Location, i, 1) <> "\"
i -= 1
End While
'Remember the path for later reference
path = System.Reflection.Assembly.GetExecutingAssembly.Location.Substring(0, i - 1)
SaveFileDialog1.InitialDirectory = path
SaveFileDialog1.ShowDialog()
MsgBox("Your sample text is saved in the following location: " & SaveFileDialog1.FileName)
filenum = FreeFile()
FileOpen(filenum, SaveFileDialog1.FileName, OpenMode.Output)
PrintLine(filenum, xyz.txtOrderNo.Text)
FileClose(filenum)
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|