Google Gruplar, artık yeni Usenet gönderilerini veya aboneliklerini desteklememektedir. Geçmişteki içerikler görüntülenebilir kalmaya devam edecek.

read text file in vb.net compact framework

124 görüntüleme
İlk okunmamış mesaja atla

Daniele Martignago

okunmadı,
6 May 2003 11:56:336.05.2003
alıcı
Hi,
I'm new with .net and CF.
I use Microsoft Smart Device Extensions for Visual Studio .NET Version
7.00.2098.
I build a text file on my Pc using Notepad and then copied to the device.
I am trying to read the text file with this code:

Dim path as String = "\temp\my test.txt"
Try

Dim sr as StreamReader = New StreaReader(path,
System.Text.Encoding.ASCII)
Dim strLine as String

strLine = sr.Readline

Do While (Not strLine is Nothing)
MessageBox.Show(strLine)
strLine = sr.ReadLine
Loop

Catch e As Exception
MessageBox.Show ("Error: ", e.toString())
End Try


My problem is this: when I read lines the messagebox show strange text like
"\}qoklmngh{oklmnops{|}.."

Any Idea? Need some conversion?
Thanks all.
--
Martignago Daniele

Alex Feinman

okunmadı,
6 May 2003 12:32:186.05.2003
alıcı
On Windows CE devices text files are typically unicode. In your code try
replacing Encoding.ASCII with Encoding.Unicode or just omit this parameter -
the default is Unicode and would work

"Daniele Martignago" <marti...@ergon.it> wrote in message
news:eeBERi%23EDH...@TK2MSFTNGP12.phx.gbl...

Eric de carufel

okunmadı,
14 May 2003 11:12:4714.05.2003
alıcı
Hi there,
We are experiencing the same problem under C#.
Does the Visual Studio 2003 developement suite solves the
problem ?

You are not alone :(

>.
>

Ginny Caughey [MVP]

okunmadı,
14 May 2003 11:28:5314.05.2003
alıcı
Eric,

How do you know that the text file is ASCII? Look at it with a hex editor.
--
Ginny Caughey
Windows Embedded MVP

"Eric de carufel" <eric.de...@imagina.ca> wrote in message
news:0fe201c31a2b$46edeea0$3101...@phx.gbl...

0 yeni ileti