File Extension

Ruud

Member
Joined
Jan 2, 2007
Messages
10
Programming Experience
1-3
hello everyone, i need some help.

i'm developing program application for smartdevice (pocket pc 2003 SE) and i use vb.net 2005. but i have problems to save my variable value to a file with special extention. i want to save my file with dss extention (*.dss). but i can do that in smartdevice. i use these code to save and open my file.

' to save my variable value in a file (*.dss)
VB.NET:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save.Click
Dim objSaveFileDialog As New SaveFileDialog
'Set the Save dialog properties
With objSaveFileDialog
 
.FileName = "Test"
.Filter = "dss files (*.dss)|*.dss"
.FilterIndex = 1
 
End With
 
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
outputfile = New IO.StreamWriter(SaveFileDialog1.FileName, False)
 
outputfile.WriteLine(x)
outputfile.WriteLine(y)
outputfile.WriteLine(z)
 
outputfile.Close()
 
End If
objSaveFileDialog.Dispose()
objSaveFileDialog = Nothing
End Sub
'to open and filter only file with dss extention only (*.dss)
VB.NET:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Open.Click
Dim myFileDialog As OpenFileDialog = New OpenFileDialog
With myFileDialog
.Filter = "dss files (*.dss)|*.dss"
.FilterIndex = 1
 
End With
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
inputfile = New IO.StreamReader(OpenFileDialog1.FileName, False)
x = inputfile.ReadLine
y = inputfile.ReadLine
z = inputfile.ReadLine
 
inputfile.Close()
 
End If
End Sub
these code running well when i use it for windows application, but there are some problems when i use it for smartdevice, using vb.net 2005. the first problem occure when i save my varible value as a file, the extention not automatically to *.dss, but the file saved without an extention. so i must type the extention manually.
example: test.dss
what must i do? i need some help

the 2nd problem occure when i open my file. in my code i have filtered only open *.dss file. but it didn't work.
so what must i do so that i can use that code to save in *.dss file automatically and when i open a file, the program automatically filter only *.dss file.

these problem only occure when i use it for smartdevice using .net compact framework 2.0, but running well when i use it for windows application useing VB.net 2005 (.net compact framework 2.0)
i need some help and advise
thanks for your help and attentions
 
Last edited by a moderator:
the extention can be anytings. in this case i just want to save my file into *.dss. i had write the program and it run well in Ms. windows xp, but
when i try to write my program in Windows mobile 2003, the program still running, but the extention not set automatically to *.dss but its save without extention but in my Ms.windows Xp it work.
my proble are:
i want to save my varible value into a file, the extention automatically for exampe *.dss. and when i want it, i can load that file by clicking button 'OPEN' into my program so i get my variable value again.
Thanks..
 
Back
Top