|
-
Mar 22nd, 2011, 04:14 AM
#1
Thread Starter
New Member
Save file extensions
Hi all,
new to VB, im used to C programming, so a few bits here have me confused.
Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveAsToolStripMenuItem.Click
timedate.Stop()
Dim strFileName As String
With SaveFileDialog1
.InitialDirectory = "C:\"
.Filter = " txt(*.txt)|*. |AllFiles (*.*) |*.*"
.FilterIndex = 1
.CheckFileExists = False
.Title = "Save Files"
.OverwritePrompt = True
If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
strFileName = .FileName
Dim myStream As New System.IO.StreamWriter(strFileName & ".GDL", False)
If TMI = True Then
myStream.Write("Version 1.4.1" & Chr(13) & Chr(10))
Else
myStream.Write("Version 1.4.0" & Chr(13) & Chr(10))
End If
For arrayindex = 0 To 512
If Mid(bigarray(arrayindex), 20, 10) = "FFFFFFFFFF" Then
GoTo endloop
End If
myStream.Write(bigarray(arrayindex) & Chr(13) & Chr(10))
Next arrayindex
endloop:
myStream.Close()
myStream = Nothing
timedate.Start()
End If
End With
End Sub
The problem is that if I save a file I get "myfile.GDL" if I overwrite that I get a new file "myfile.GDL.GDL" ect.
the other problem being that the filtering in the windows save/open dialog wont show .GDL files unless I select "all files"
Any help would be great.
Cheers
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
|