Opening text files in Pocket PC .net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,
I would like to open a text file and read in the contects line by line, I
have tried using the following line like I have used in the regular .net
before but it doesn't work in pocket pc .net (to read the text I would
normally use lineinput):

FileOpen(1, "Textfile.txt", OpenMode.Input)

Thanks in advance,
Roger.
 
Roger,

Here's a sample for you of processing a text file line by line with
comma-separated values:

using System.IO;
/////
try
{
FileInfo f = new FileInfo(fileName);
using ( StreamReader sr = f.OpenText() )
{
String line;
while ( ( line = sr.ReadLine() ) != null )
{
string[] values = line.Split(',');
foreach(string s in values)
{
// do something with the data
}
}
}
}
catch ....

-Darren Shafer
 
Thanks for the code Darren but that does not work either, I am using VB
(forgot to say before). I am also a little puzzled where I can use system.IO,
I have tried to add the reference but it does not exist in the available list
of references.

Roger.

Darren Shaffer said:
Roger,

Here's a sample for you of processing a text file line by line with
comma-separated values:

using System.IO;
/////
try
{
FileInfo f = new FileInfo(fileName);
using ( StreamReader sr = f.OpenText() )
{
String line;
while ( ( line = sr.ReadLine() ) != null )
{
string[] values = line.Split(',');
foreach(string s in values)
{
// do something with the data
}
}
}
}
catch ....

-Darren Shafer


Roger said:
Hi All,
I would like to open a text file and read in the contects line by line, I
have tried using the following line like I have used in the regular .net
before but it doesn't work in pocket pc .net (to read the text I would
normally use lineinput):

FileOpen(1, "Textfile.txt", OpenMode.Input)

Thanks in advance,
Roger.
 
Are you sure you're building a Smart Device application using VB.Net?
The fact that you don't see System.IO tells me you're probably not.

This is the compactframework newsgroup. If you're using eVB, you
may want to post in microsoft.public.pocketpc.developer

-Darren


Roger said:
Thanks for the code Darren but that does not work either, I am using VB
(forgot to say before). I am also a little puzzled where I can use
system.IO,
I have tried to add the reference but it does not exist in the available
list
of references.

Roger.

Darren Shaffer said:
Roger,

Here's a sample for you of processing a text file line by line with
comma-separated values:

using System.IO;
/////
try
{
FileInfo f = new FileInfo(fileName);
using ( StreamReader sr = f.OpenText() )
{
String line;
while ( ( line = sr.ReadLine() ) != null )
{
string[] values = line.Split(',');
foreach(string s in values)
{
// do something with the data
}
}
}
}
catch ....

-Darren Shafer


Roger said:
Hi All,
I would like to open a text file and read in the contects line by line,
I
have tried using the following line like I have used in the regular
.net
before but it doesn't work in pocket pc .net (to read the text I would
normally use lineinput):

FileOpen(1, "Textfile.txt", OpenMode.Input)

Thanks in advance,
Roger.
 
Hi Darren,
I have just changed over from eVB to .net (I could open and read txt files
in eVB no problem). I am using VS.net 2003 to build a smart device app in VB,
I have the app running on my pocket pc but just need to access the text file
and read it in to finish the app.

Roger.


Darren Shaffer said:
Are you sure you're building a Smart Device application using VB.Net?
The fact that you don't see System.IO tells me you're probably not.

This is the compactframework newsgroup. If you're using eVB, you
may want to post in microsoft.public.pocketpc.developer

-Darren


Roger said:
Thanks for the code Darren but that does not work either, I am using VB
(forgot to say before). I am also a little puzzled where I can use
system.IO,
I have tried to add the reference but it does not exist in the available
list
of references.

Roger.

Darren Shaffer said:
Roger,

Here's a sample for you of processing a text file line by line with
comma-separated values:

using System.IO;
/////
try
{
FileInfo f = new FileInfo(fileName);
using ( StreamReader sr = f.OpenText() )
{
String line;
while ( ( line = sr.ReadLine() ) != null )
{
string[] values = line.Split(',');
foreach(string s in values)
{
// do something with the data
}
}
}
}
catch ....

-Darren Shafer


Hi All,
I would like to open a text file and read in the contects line by line,
I
have tried using the following line like I have used in the regular
.net
before but it doesn't work in pocket pc .net (to read the text I would
normally use lineinput):

FileOpen(1, "Textfile.txt", OpenMode.Input)

Thanks in advance,
Roger.
 
can you add "Imports System.IO"

to your code and get it to compile? if so, try this:

Try
' Create an instance of StreamReader to read from a file.
Dim sr As StreamReader = New StreamReader("TestFile.txt")
Dim line As String
Do
line = sr.ReadLine()
// do something with the line of text from the file
Loop Until line Is Nothing
sr.Close()
Catch E As Exception
' Let the user know what went wrong.
End Try

-Darren


Roger said:
Hi Darren,
I have just changed over from eVB to .net (I could open and read txt files
in eVB no problem). I am using VS.net 2003 to build a smart device app in
VB,
I have the app running on my pocket pc but just need to access the text
file
and read it in to finish the app.

Roger.


Darren Shaffer said:
Are you sure you're building a Smart Device application using VB.Net?
The fact that you don't see System.IO tells me you're probably not.

This is the compactframework newsgroup. If you're using eVB, you
may want to post in microsoft.public.pocketpc.developer

-Darren


Roger said:
Thanks for the code Darren but that does not work either, I am using VB
(forgot to say before). I am also a little puzzled where I can use
system.IO,
I have tried to add the reference but it does not exist in the
available
list
of references.

Roger.

:

Roger,

Here's a sample for you of processing a text file line by line with
comma-separated values:

using System.IO;
/////
try
{
FileInfo f = new FileInfo(fileName);
using ( StreamReader sr = f.OpenText() )
{
String line;
while ( ( line = sr.ReadLine() ) != null )
{
string[] values = line.Split(',');
foreach(string s in values)
{
// do something with the data
}
}
}
}
catch ....

-Darren Shafer


Hi All,
I would like to open a text file and read in the contects line by
line,
I
have tried using the following line like I have used in the regular
.net
before but it doesn't work in pocket pc .net (to read the text I
would
normally use lineinput):

FileOpen(1, "Textfile.txt", OpenMode.Input)

Thanks in advance,
Roger.
 
Don't forget to readline before entering the loop and more importantly
shouldn't the sr.Close be in a Finally block (to mimic your C# using
statement)?

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


Darren Shaffer said:
can you add "Imports System.IO"

to your code and get it to compile? if so, try this:

Try
' Create an instance of StreamReader to read from a file.
Dim sr As StreamReader = New StreamReader("TestFile.txt")
Dim line As String
Do
line = sr.ReadLine()
// do something with the line of text from the file
Loop Until line Is Nothing
sr.Close()
Catch E As Exception
' Let the user know what went wrong.
End Try

-Darren


Roger said:
Hi Darren,
I have just changed over from eVB to .net (I could open and read txt
files
in eVB no problem). I am using VS.net 2003 to build a smart device app in
VB,
I have the app running on my pocket pc but just need to access the text
file
and read it in to finish the app.

Roger.


Darren Shaffer said:
Are you sure you're building a Smart Device application using VB.Net?
The fact that you don't see System.IO tells me you're probably not.

This is the compactframework newsgroup. If you're using eVB, you
may want to post in microsoft.public.pocketpc.developer

-Darren


Thanks for the code Darren but that does not work either, I am using
VB
(forgot to say before). I am also a little puzzled where I can use
system.IO,
I have tried to add the reference but it does not exist in the
available
list
of references.

Roger.

:

Roger,

Here's a sample for you of processing a text file line by line with
comma-separated values:

using System.IO;
/////
try
{
FileInfo f = new FileInfo(fileName);
using ( StreamReader sr = f.OpenText() )
{
String line;
while ( ( line = sr.ReadLine() ) != null )
{
string[] values = line.Split(',');
foreach(string s in values)
{
// do something with the data
}
}
}
}
catch ....

-Darren Shafer


Hi All,
I would like to open a text file and read in the contects line by
line,
I
have tried using the following line like I have used in the regular
.net
before but it doesn't work in pocket pc .net (to read the text I
would
normally use lineinput):

FileOpen(1, "Textfile.txt", OpenMode.Input)

Thanks in advance,
Roger.
 
Hi,
take a look at the white paper on migrating eVB file access to VB.Net - it
could be just what you are looking for

http://msdn.microsoft.com/mobility/...n-us/dnppcgen/html/migrating_evb_controls.asp


Pete

--
Pete Vickers
Microsoft .NET Compact Framework MVP
HP Business Partner
http://www.gui-innovations.com

Roger said:
Hi Darren,
I have just changed over from eVB to .net (I could open and read txt files
in eVB no problem). I am using VS.net 2003 to build a smart device app in
VB,
I have the app running on my pocket pc but just need to access the text
file
and read it in to finish the app.

Roger.


Darren Shaffer said:
Are you sure you're building a Smart Device application using VB.Net?
The fact that you don't see System.IO tells me you're probably not.

This is the compactframework newsgroup. If you're using eVB, you
may want to post in microsoft.public.pocketpc.developer

-Darren


Roger said:
Thanks for the code Darren but that does not work either, I am using VB
(forgot to say before). I am also a little puzzled where I can use
system.IO,
I have tried to add the reference but it does not exist in the
available
list
of references.

Roger.

:

Roger,

Here's a sample for you of processing a text file line by line with
comma-separated values:

using System.IO;
/////
try
{
FileInfo f = new FileInfo(fileName);
using ( StreamReader sr = f.OpenText() )
{
String line;
while ( ( line = sr.ReadLine() ) != null )
{
string[] values = line.Split(',');
foreach(string s in values)
{
// do something with the data
}
}
}
}
catch ....

-Darren Shafer


Hi All,
I would like to open a text file and read in the contects line by
line,
I
have tried using the following line like I have used in the regular
.net
before but it doesn't work in pocket pc .net (to read the text I
would
normally use lineinput):

FileOpen(1, "Textfile.txt", OpenMode.Input)

Thanks in advance,
Roger.
 
Thanks to all, especially you Pete, the article is exactly what I have been
looking for, I remember your name from eVB forum - you helped me out a lot
then as well - thanks very much.
Roger.

Pete Vickers said:
Hi,
take a look at the white paper on migrating eVB file access to VB.Net - it
could be just what you are looking for

http://msdn.microsoft.com/mobility/...n-us/dnppcgen/html/migrating_evb_controls.asp


Pete

--
Pete Vickers
Microsoft .NET Compact Framework MVP
HP Business Partner
http://www.gui-innovations.com

Roger said:
Hi Darren,
I have just changed over from eVB to .net (I could open and read txt files
in eVB no problem). I am using VS.net 2003 to build a smart device app in
VB,
I have the app running on my pocket pc but just need to access the text
file
and read it in to finish the app.

Roger.


Darren Shaffer said:
Are you sure you're building a Smart Device application using VB.Net?
The fact that you don't see System.IO tells me you're probably not.

This is the compactframework newsgroup. If you're using eVB, you
may want to post in microsoft.public.pocketpc.developer

-Darren


Thanks for the code Darren but that does not work either, I am using VB
(forgot to say before). I am also a little puzzled where I can use
system.IO,
I have tried to add the reference but it does not exist in the
available
list
of references.

Roger.

:

Roger,

Here's a sample for you of processing a text file line by line with
comma-separated values:

using System.IO;
/////
try
{
FileInfo f = new FileInfo(fileName);
using ( StreamReader sr = f.OpenText() )
{
String line;
while ( ( line = sr.ReadLine() ) != null )
{
string[] values = line.Split(',');
foreach(string s in values)
{
// do something with the data
}
}
}
}
catch ....

-Darren Shafer


Hi All,
I would like to open a text file and read in the contects line by
line,
I
have tried using the following line like I have used in the regular
.net
before but it doesn't work in pocket pc .net (to read the text I
would
normally use lineinput):

FileOpen(1, "Textfile.txt", OpenMode.Input)

Thanks in advance,
Roger.
 
I am still having problems with this, it seems that my problem may be due to
the fact that I do not have the system.io reference, I have no idea why that
might be - when I right click references in the solutions explorer and select
add, system.io is not in the list. Can I add imports system.io into my code
and if so where should I put it - I have tried but get either syntax error or
'imports' statement must precede and declarations (I've tried pasting it
loads of places.

Thanks in advance - - - if anyone can help.

Roger.

Roger said:
Thanks to all, especially you Pete, the article is exactly what I have been
looking for, I remember your name from eVB forum - you helped me out a lot
then as well - thanks very much.
Roger.

Pete Vickers said:
Hi,
take a look at the white paper on migrating eVB file access to VB.Net - it
could be just what you are looking for

http://msdn.microsoft.com/mobility/...n-us/dnppcgen/html/migrating_evb_controls.asp


Pete

--
Pete Vickers
Microsoft .NET Compact Framework MVP
HP Business Partner
http://www.gui-innovations.com

Roger said:
Hi Darren,
I have just changed over from eVB to .net (I could open and read txt files
in eVB no problem). I am using VS.net 2003 to build a smart device app in
VB,
I have the app running on my pocket pc but just need to access the text
file
and read it in to finish the app.

Roger.


:

Are you sure you're building a Smart Device application using VB.Net?
The fact that you don't see System.IO tells me you're probably not.

This is the compactframework newsgroup. If you're using eVB, you
may want to post in microsoft.public.pocketpc.developer

-Darren


Thanks for the code Darren but that does not work either, I am using VB
(forgot to say before). I am also a little puzzled where I can use
system.IO,
I have tried to add the reference but it does not exist in the
available
list
of references.

Roger.

:

Roger,

Here's a sample for you of processing a text file line by line with
comma-separated values:

using System.IO;
/////
try
{
FileInfo f = new FileInfo(fileName);
using ( StreamReader sr = f.OpenText() )
{
String line;
while ( ( line = sr.ReadLine() ) != null )
{
string[] values = line.Split(',');
foreach(string s in values)
{
// do something with the data
}
}
}
}
catch ....

-Darren Shafer


Hi All,
I would like to open a text file and read in the contects line by
line,
I
have tried using the following line like I have used in the regular
.net
before but it doesn't work in pocket pc .net (to read the text I
would
normally use lineinput):

FileOpen(1, "Textfile.txt", OpenMode.Input)

Thanks in advance,
Roger.
 
Hi,
first statment (s) e.g.

Imports System.io
Public Class Form1
Inherits System.Windows.Forms.Form
..........


Pete

--
Pete Vickers
Microsoft .NET Compact Framework MVP
HP Business Partner
http://www.gui-innovations.com

Roger said:
I am still having problems with this, it seems that my problem may be due
to
the fact that I do not have the system.io reference, I have no idea why
that
might be - when I right click references in the solutions explorer and
select
add, system.io is not in the list. Can I add imports system.io into my
code
and if so where should I put it - I have tried but get either syntax error
or
'imports' statement must precede and declarations (I've tried pasting it
loads of places.

Thanks in advance - - - if anyone can help.

Roger.

Roger said:
Thanks to all, especially you Pete, the article is exactly what I have
been
looking for, I remember your name from eVB forum - you helped me out a
lot
then as well - thanks very much.
Roger.

Pete Vickers said:
Hi,
take a look at the white paper on migrating eVB file access to VB.Net -
it
could be just what you are looking for

http://msdn.microsoft.com/mobility/...n-us/dnppcgen/html/migrating_evb_controls.asp


Pete

--
Pete Vickers
Microsoft .NET Compact Framework MVP
HP Business Partner
http://www.gui-innovations.com

Hi Darren,
I have just changed over from eVB to .net (I could open and read txt
files
in eVB no problem). I am using VS.net 2003 to build a smart device
app in
VB,
I have the app running on my pocket pc but just need to access the
text
file
and read it in to finish the app.

Roger.


:

Are you sure you're building a Smart Device application using
VB.Net?
The fact that you don't see System.IO tells me you're probably not.

This is the compactframework newsgroup. If you're using eVB, you
may want to post in microsoft.public.pocketpc.developer

-Darren


Thanks for the code Darren but that does not work either, I am
using VB
(forgot to say before). I am also a little puzzled where I can use
system.IO,
I have tried to add the reference but it does not exist in the
available
list
of references.

Roger.

:

Roger,

Here's a sample for you of processing a text file line by line
with
comma-separated values:

using System.IO;
/////
try
{
FileInfo f = new FileInfo(fileName);
using ( StreamReader sr = f.OpenText() )
{
String line;
while ( ( line = sr.ReadLine() ) != null )
{
string[] values = line.Split(',');
foreach(string s in values)
{
// do something with the data
}
}
}
}
catch ....

-Darren Shafer


Hi All,
I would like to open a text file and read in the contects line
by
line,
I
have tried using the following line like I have used in the
regular
.net
before but it doesn't work in pocket pc .net (to read the text
I
would
normally use lineinput):

FileOpen(1, "Textfile.txt", OpenMode.Input)

Thanks in advance,
Roger.
 
I have put imports system.io right at the top of the code and now the
streamreader code will compile without any errors. I am now having a file not
found exception when I run the event that does the file thing - I have tried
various paths when running the app on my device (cannot seem to find how to
import the file into the emulator), my VS.net runs the ppc 2002 emulator.
Could anyone recommend any good books on VB.net - for both regular and smart
device. I will start a new topic on this forum if I get no replies to this
post.

Thanks again, Roger.

Pete Vickers said:
Hi,
first statment (s) e.g.

Imports System.io
Public Class Form1
Inherits System.Windows.Forms.Form
..........


Pete

--
Pete Vickers
Microsoft .NET Compact Framework MVP
HP Business Partner
http://www.gui-innovations.com

Roger said:
I am still having problems with this, it seems that my problem may be due
to
the fact that I do not have the system.io reference, I have no idea why
that
might be - when I right click references in the solutions explorer and
select
add, system.io is not in the list. Can I add imports system.io into my
code
and if so where should I put it - I have tried but get either syntax error
or
'imports' statement must precede and declarations (I've tried pasting it
loads of places.

Thanks in advance - - - if anyone can help.

Roger.

Roger said:
Thanks to all, especially you Pete, the article is exactly what I have
been
looking for, I remember your name from eVB forum - you helped me out a
lot
then as well - thanks very much.
Roger.

:

Hi,
take a look at the white paper on migrating eVB file access to VB.Net -
it
could be just what you are looking for

http://msdn.microsoft.com/mobility/...n-us/dnppcgen/html/migrating_evb_controls.asp


Pete

--
Pete Vickers
Microsoft .NET Compact Framework MVP
HP Business Partner
http://www.gui-innovations.com

Hi Darren,
I have just changed over from eVB to .net (I could open and read txt
files
in eVB no problem). I am using VS.net 2003 to build a smart device
app in
VB,
I have the app running on my pocket pc but just need to access the
text
file
and read it in to finish the app.

Roger.


:

Are you sure you're building a Smart Device application using
VB.Net?
The fact that you don't see System.IO tells me you're probably not.

This is the compactframework newsgroup. If you're using eVB, you
may want to post in microsoft.public.pocketpc.developer

-Darren


Thanks for the code Darren but that does not work either, I am
using VB
(forgot to say before). I am also a little puzzled where I can use
system.IO,
I have tried to add the reference but it does not exist in the
available
list
of references.

Roger.

:

Roger,

Here's a sample for you of processing a text file line by line
with
comma-separated values:

using System.IO;
/////
try
{
FileInfo f = new FileInfo(fileName);
using ( StreamReader sr = f.OpenText() )
{
String line;
while ( ( line = sr.ReadLine() ) != null )
{
string[] values = line.Split(',');
foreach(string s in values)
{
// do something with the data
}
}
}
}
catch ....

-Darren Shafer


Hi All,
I would like to open a text file and read in the contects line
by
line,
I
have tried using the following line like I have used in the
regular
.net
before but it doesn't work in pocket pc .net (to read the text
I
would
normally use lineinput):

FileOpen(1, "Textfile.txt", OpenMode.Input)

Thanks in advance,
Roger.
 
CE has no concept of a current directpory, so you must use either a full
path from the root, or get the path your app launched from using reflection
(or the SDF's ApplicationEx.StartupPath property)

--
<ctacke/>
www.opennetcf.org/sdf
Winner of the 2004 Pocket PC Magazine Best Software award


Roger said:
I have put imports system.io right at the top of the code and now the
streamreader code will compile without any errors. I am now having a file
not
found exception when I run the event that does the file thing - I have
tried
various paths when running the app on my device (cannot seem to find how
to
import the file into the emulator), my VS.net runs the ppc 2002 emulator.
Could anyone recommend any good books on VB.net - for both regular and
smart
device. I will start a new topic on this forum if I get no replies to this
post.

Thanks again, Roger.

Pete Vickers said:
Hi,
first statment (s) e.g.

Imports System.io
Public Class Form1
Inherits System.Windows.Forms.Form
..........


Pete

--
Pete Vickers
Microsoft .NET Compact Framework MVP
HP Business Partner
http://www.gui-innovations.com

Roger said:
I am still having problems with this, it seems that my problem may be
due
to
the fact that I do not have the system.io reference, I have no idea why
that
might be - when I right click references in the solutions explorer and
select
add, system.io is not in the list. Can I add imports system.io into my
code
and if so where should I put it - I have tried but get either syntax
error
or
'imports' statement must precede and declarations (I've tried pasting
it
loads of places.

Thanks in advance - - - if anyone can help.

Roger.

:

Thanks to all, especially you Pete, the article is exactly what I have
been
looking for, I remember your name from eVB forum - you helped me out a
lot
then as well - thanks very much.
Roger.

:

Hi,
take a look at the white paper on migrating eVB file access to
VB.Net -
it
could be just what you are looking for

http://msdn.microsoft.com/mobility/...n-us/dnppcgen/html/migrating_evb_controls.asp


Pete

--
Pete Vickers
Microsoft .NET Compact Framework MVP
HP Business Partner
http://www.gui-innovations.com

Hi Darren,
I have just changed over from eVB to .net (I could open and read
txt
files
in eVB no problem). I am using VS.net 2003 to build a smart device
app in
VB,
I have the app running on my pocket pc but just need to access the
text
file
and read it in to finish the app.

Roger.


:

Are you sure you're building a Smart Device application using
VB.Net?
The fact that you don't see System.IO tells me you're probably
not.

This is the compactframework newsgroup. If you're using eVB, you
may want to post in microsoft.public.pocketpc.developer

-Darren


Thanks for the code Darren but that does not work either, I am
using VB
(forgot to say before). I am also a little puzzled where I can
use
system.IO,
I have tried to add the reference but it does not exist in the
available
list
of references.

Roger.

:

Roger,

Here's a sample for you of processing a text file line by line
with
comma-separated values:

using System.IO;
/////
try
{
FileInfo f = new FileInfo(fileName);
using ( StreamReader sr = f.OpenText() )
{
String line;
while ( ( line = sr.ReadLine() ) != null )
{
string[] values = line.Split(',');
foreach(string s in values)
{
// do something with the data
}
}
}
}
catch ....

-Darren Shafer


Hi All,
I would like to open a text file and read in the contects
line
by
line,
I
have tried using the following line like I have used in the
regular
.net
before but it doesn't work in pocket pc .net (to read the
text
I
would
normally use lineinput):

FileOpen(1, "Textfile.txt", OpenMode.Input)

Thanks in advance,
Roger.
 
I'm finally up and running.

Thanks to all for your help.

Roger.

Chris Tacke said:
CE has no concept of a current directpory, so you must use either a full
path from the root, or get the path your app launched from using reflection
(or the SDF's ApplicationEx.StartupPath property)

--
<ctacke/>
www.opennetcf.org/sdf
Winner of the 2004 Pocket PC Magazine Best Software award


Roger said:
I have put imports system.io right at the top of the code and now the
streamreader code will compile without any errors. I am now having a file
not
found exception when I run the event that does the file thing - I have
tried
various paths when running the app on my device (cannot seem to find how
to
import the file into the emulator), my VS.net runs the ppc 2002 emulator.
Could anyone recommend any good books on VB.net - for both regular and
smart
device. I will start a new topic on this forum if I get no replies to this
post.

Thanks again, Roger.

Pete Vickers said:
Hi,
first statment (s) e.g.

Imports System.io
Public Class Form1
Inherits System.Windows.Forms.Form
..........


Pete

--
Pete Vickers
Microsoft .NET Compact Framework MVP
HP Business Partner
http://www.gui-innovations.com

I am still having problems with this, it seems that my problem may be
due
to
the fact that I do not have the system.io reference, I have no idea why
that
might be - when I right click references in the solutions explorer and
select
add, system.io is not in the list. Can I add imports system.io into my
code
and if so where should I put it - I have tried but get either syntax
error
or
'imports' statement must precede and declarations (I've tried pasting
it
loads of places.

Thanks in advance - - - if anyone can help.

Roger.

:

Thanks to all, especially you Pete, the article is exactly what I have
been
looking for, I remember your name from eVB forum - you helped me out a
lot
then as well - thanks very much.
Roger.

:

Hi,
take a look at the white paper on migrating eVB file access to
VB.Net -
it
could be just what you are looking for

http://msdn.microsoft.com/mobility/...n-us/dnppcgen/html/migrating_evb_controls.asp


Pete

--
Pete Vickers
Microsoft .NET Compact Framework MVP
HP Business Partner
http://www.gui-innovations.com

Hi Darren,
I have just changed over from eVB to .net (I could open and read
txt
files
in eVB no problem). I am using VS.net 2003 to build a smart device
app in
VB,
I have the app running on my pocket pc but just need to access the
text
file
and read it in to finish the app.

Roger.


:

Are you sure you're building a Smart Device application using
VB.Net?
The fact that you don't see System.IO tells me you're probably
not.

This is the compactframework newsgroup. If you're using eVB, you
may want to post in microsoft.public.pocketpc.developer

-Darren


Thanks for the code Darren but that does not work either, I am
using VB
(forgot to say before). I am also a little puzzled where I can
use
system.IO,
I have tried to add the reference but it does not exist in the
available
list
of references.

Roger.

:

Roger,

Here's a sample for you of processing a text file line by line
with
comma-separated values:

using System.IO;
/////
try
{
FileInfo f = new FileInfo(fileName);
using ( StreamReader sr = f.OpenText() )
{
String line;
while ( ( line = sr.ReadLine() ) != null )
{
string[] values = line.Split(',');
foreach(string s in values)
{
// do something with the data
}
}
}
}
catch ....

-Darren Shafer


Hi All,
I would like to open a text file and read in the contects
line
by
line,
I
have tried using the following line like I have used in the
regular
.net
before but it doesn't work in pocket pc .net (to read the
text
I
would
normally use lineinput):

FileOpen(1, "Textfile.txt", OpenMode.Input)

Thanks in advance,
Roger.
 
Back
Top