Click here to Skip to main content
15,893,487 members
Home / Discussions / Mobile
   

Mobile

 
QuestionMenuItem.Click event stops working Pin
Mark Lison17-Jul-08 5:57
Mark Lison17-Jul-08 5:57 
AnswerRe: MenuItem.Click event stops working Pin
Mark Lison31-Jul-08 0:14
Mark Lison31-Jul-08 0:14 
QuestionTransparent Controls in WM 5.0 Pin
akirilov15-Jul-08 5:02
akirilov15-Jul-08 5:02 
QuestionInvalidProgramException: When running the WM6.0 application on the WM5.0 device even after the Platform is changed Pin
kaushik_Manoj15-Jul-08 0:35
kaushik_Manoj15-Jul-08 0:35 
QuestionP/Invoke can not find dll Pin
xibeifeijian14-Jul-08 20:51
xibeifeijian14-Jul-08 20:51 
AnswerRe: P/Invoke can not find dll Pin
Luc Pattyn16-Jul-08 2:00
sitebuilderLuc Pattyn16-Jul-08 2:00 
GeneralRe: P/Invoke can not find dll Pin
xibeifeijian20-Jul-08 15:21
xibeifeijian20-Jul-08 15:21 
Questionopening, reading, and writing to a file (text or otherwise) on a pocket pc using visual basic net 2003 Pin
linuxskater13-Jul-08 17:13
linuxskater13-Jul-08 17:13 
I tried to write a program that involved a file opening, reading, and wrting to a text file in vb.net 2003. It works well in vb.net 2003 but when I use it in vb.net 2003 for my pocket pc application, it does not read, nor write, only opens the file. Can you help me??

Here is the code:


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim sFileName As String = "\Test.txt"
Dim myFileStream As System.IO.FileStream

Try

'We have our variables, lets attempt to open it
myFileStream = New System.IO.FileStream(sFileName, _
FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite)

Catch

'Make sure that it exists, and if it doesn't display an error
MessageBox.Show("Cannot not open the file. Make sure in the location shown.")

Finally

'It works, but we are going to try one last method
If myFileStream.CanRead = True Then
'This is where we would read from the file
Label6.Text = "File opened!"
txtFileDisplay.Text = "File opened!"

'We are done with the file now, so close it
myFileStream.Close()
End If

End Try



End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Declare those variables!
'Dim sFileName As String = Application.StartupPath & "\VB.txt"
Dim sFileName As String = "\Test.txt"
Dim myFileStream As New System.IO.FileStream(sFileName, _
FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None)


'Create the stream writer
Dim myWriter As New System.IO.StreamWriter(myFileStream)

'Write in what is in the text box
'myWriter.WriteLine("It works, thank God!")
myWriter.WriteLine(txtFileDisplay.Text)

'Flush before we close
myWriter.Flush()

'Close everything
myWriter.Close()
myFileStream.Close()

'Clear the text
Label6.Text = ""
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Declare any variables
Dim sFileName As String = "\Text.txt"
Dim myFileStream As New System.IO.FileStream(sFileName, _
FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read)

'Create the StreamReader and associate the filestream with it
Dim myReader As New System.IO.StreamReader(myFileStream)

'Read the entire text, and set it to a string
Dim sFileContents As String = myReader.ReadToEnd()

'Print it to the textbox
'Label6.Text = sFileContents
txtFileDisplay.Text = sFileContents

'Close everything when you are finished
myReader.Close()
myFileStream.Close()
End Sub
End Class
AnswerRe: opening, reading, and writing to a file (text or otherwise) on a pocket pc using visual basic net 2003 Pin
Rupesh Kumar Swami14-Jul-08 20:27
Rupesh Kumar Swami14-Jul-08 20:27 
GeneralRe: opening, reading, and writing to a file (text or otherwise) on a pocket pc using visual basic net 2003 Pin
linuxskater15-Jul-08 4:21
linuxskater15-Jul-08 4:21 
QuestionSending a string from a PDA using the serial port Pin
Alin T13-Jul-08 7:51
Alin T13-Jul-08 7:51 
AnswerRe: Sending a string from a PDA using the serial port Pin
akirilov13-Jul-08 21:31
akirilov13-Jul-08 21:31 
QuestionSetup & related for EVC application Pin
Trupti Mehta11-Jul-08 0:28
Trupti Mehta11-Jul-08 0:28 
QuestionTransparent image problem in Compact Framework 3.5 Pin
Subasish_CodeProject10-Jul-08 20:51
Subasish_CodeProject10-Jul-08 20:51 
QuestionAdd animated gif image to Smart Device Application Pin
Dushan12310-Jul-08 19:00
Dushan12310-Jul-08 19:00 
AnswerRe: Add animated gif image to Smart Device Application Pin
Iain Clarke, Warrior Programmer1-Aug-08 0:18
Iain Clarke, Warrior Programmer1-Aug-08 0:18 
Questionproblem with java webservice and WM5 Pin
Newbie_Toy7-Jul-08 21:36
Newbie_Toy7-Jul-08 21:36 
QuestionGDI+ for WM5.0 with C++ (native) [modified] Pin
akirilov7-Jul-08 20:43
akirilov7-Jul-08 20:43 
AnswerRe: GDI+ for WM5.0 with C++ (native) Pin
tapan.x.bansal25-Jul-08 6:15
tapan.x.bansal25-Jul-08 6:15 
GeneralRe: GDI+ for WM5.0 with C++ (native) Pin
akirilov30-Jul-08 20:30
akirilov30-Jul-08 20:30 
Questioncamera capture using wimoNative dll Pin
Samuel Ong3-Jul-08 9:04
Samuel Ong3-Jul-08 9:04 
QuestionWindows CE emulator Pin
iayd3-Jul-08 2:23
iayd3-Jul-08 2:23 
AnswerRe: Windows CE emulator Pin
Trupti Mehta4-Jul-08 4:27
Trupti Mehta4-Jul-08 4:27 
Questionwhich institute Pin
Ebube2-Jul-08 23:03
Ebube2-Jul-08 23:03 
AnswerRe: which institute Pin
hereicome16-Jul-08 1:42
hereicome16-Jul-08 1:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.