PPC

  • Thread starter Thread starter Gustavo Arriola
  • Start date Start date
G

Gustavo Arriola

How do I access a specific file if it is in the Pocket PC?

Thank you!

Gustavo Arriola
 
I haven't worked with a PPC in some time and thus a bit rusty, but looking
over some of my code, here is a simple example of reading a text file that
is in the application path and displaying the results. The commented out
code is for larger text files.

Private Sub btnRead_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnRead.Click
Dim BasePath As String =
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
Dim Path As String = BasePath & "\Test3.txt"
If System.IO.File.Exists(Path) Then
Dim sr As New System.IO.StreamReader(Path)
MsgBox(sr.ReadToEnd)
sr.Close()
sr = Nothing
'Dim fs As System.IO.FileStream = System.IO.File.Create(Path)
'fs = System.IO.File.OpenRead(Path)
'Dim b(1024) As Byte
'Dim temp As System.Text.UTF8Encoding = New
System.Text.UTF8Encoding(True)
'Dim s As String = ""
'Do While fs.Read(b, 0, b.Length) > 0
' s = s & temp.GetString(b, 0, b.Length)
'Loop
'MsgBox(s)
'fs.Close()
'fs = Nothing
End If
End Sub
 
I'm sorry, I forgot to mention that attempt to access to the file from a
desktop application and not from same Pocket PC.

Thanks!

Gustavo Arriola
 
The idea of this is access to a database that is located in Pocket PC and to
make a synchronization, nevertheless did not want to do it by means of the
IIS since all versions of Windows do not have it.

Gustavo Arriola
 
Back
Top