The code below runs fine thru a windows APP., but does not run thru the pocket pc 2003 se emulator. Is there something wrong in the My.Computer... portion of the code Please help.
Public
Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim file As System.IO.StreamWriter Dim Record As String = CStr(TextBox1.Text) Dim procID As Integerfile =
My.Computer.FileSystem.OpenTextFileWriter("C:\HSP1.text", True)file.WriteLine(Record)
' Run batch file.procID = Shell(
"C:\HSP1.bat") ' The preceding path is for Windows XP. ' The Windows 2000 path is C:\HSP1.bat. End Sub
Running a device APP on the PC thru Pocket PC 2003 SE Emulator
sascue
Yes, quite a few things. Device (emulator is an emulated device) has no drive letters, don't support relative paths and could not see desktop's hard drives. Next, there are no batch files. And finally, I don’t believe there’s My.Computer.FileSystem on NETCF. I’m not quite sure how you managed to compile it for device. If you’re trying to run desktop binary on emulator, it won’t work.
NetPochi
smartphone/PPC devices do not have a drive letter but rather just a backslash '\' as a "root drive" letter instead. So try maybe:
My.Computer.FileSystem.OpenTextFileWriter("\somefile.txt", true)
..
alternatively you may wish to use the TextWriter in the System.IO namespace, but it should do the same as above.
Dim theFileWriter as new System.IO.StreamWriter("filename.txt")
..
..
theFileWriter.Close()
michaelp