|
-
Feb 5th, 2006, 01:26 PM
#1
Thread Starter
Junior Member
File extension
I must save a file with an extension of the type object.type.dat. How I make with savefiledialog?
Thanks.
-
Feb 5th, 2006, 01:45 PM
#2
Re: File extension
VB Code:
Dim cdlg1 As New System.windows.Forms.SaveFileDialog
Dim flnm As String
Try
If saveFileName = "" Then
Do
'Get it.
cdlg1.FileName = ""
cdlg1.Filter = "Function Files (*.FNC)|*.FNC"
cdlg1.CheckFileExists = False
If cdlg1.ShowDialog() = DialogResult.Cancel Then
Return False
Else
flnm = cdlg1.FileName
End If
Loop While flnm = ""
saveFileName = flnm
Else
flnm = saveFileName
End If
This is an incomplete piece of a function I have to save a specific type of file. It won't work as is, because saveFileName is not declared (it is global), but it should give you some ideas.
Notice that you cannot do quite what you want with the extensions: You can have .DAT appended automatically to any name, but that's all. To get the whole object.type.dat, you would probably want to just have object.type as the file name, and let the .dat be appended automatically.
My usual boring signature: Nothing
 
-
Feb 5th, 2006, 02:23 PM
#3
Thread Starter
Junior Member
Re: File extension
I have made therefore.
If .ShowDialog = DialogResult.OK Then
Dim name = .FileName
Dim end = .FileName.LastIndexOf(".")
fil = Mid(fil, 1, fine - 0)
fil = fil & ".object.type.dat"
.......
-
Feb 5th, 2006, 02:29 PM
#4
Re: File extension
That can be done. Is it working?
My usual boring signature: Nothing
 
-
Feb 5th, 2006, 02:34 PM
#5
Thread Starter
Junior Member
Re: File extension
Yes.I have used this system why I have analyzed pages web and me the system of the mid() has seemed useful.
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
|