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)
'to open and filter only file with dss extention only (*.dss)
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
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
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
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: