I would like to write an application with C# in a Windows CE 5.0 device, but
I don't know how to read/write data from/to a ASCII file in the device, and
how to copy such file to a PC when it is connected USB cable.

Would anyone provide some sample codes for reference?

Thank in advance.

Re: Newbie Question for File Handling by Peter

Peter
Wed Feb 20 01:58:48 CST 2008

There is a How To here for reading text files:-
http://msdn2.microsoft.com/en-us/library/db5x7c0d.aspx

Regarding copying it to the desktop there isn't a direct way of doing this,
you have a couple of options:-
If the operation is to be done from the desktop side you would use RAPI -
OpenNETCF.Desktop.Communication provides a .NET wrapper for this
From the device side you could use a Web Service, FTP, HTTP or a custom
Sockets implementation to send the file.

Peter

--
Peter Foot
Microsoft Device Application Development MVP
www.peterfoot.net | www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility

"wktsang1" <wktsang1@discussions.microsoft.com> wrote in message
news:9E893322-9336-4537-92CF-4C9C7D614A9F@microsoft.com...
>I would like to write an application with C# in a Windows CE 5.0 device,
>but
> I don't know how to read/write data from/to a ASCII file in the device,
> and
> how to copy such file to a PC when it is connected USB cable.
>
> Would anyone provide some sample codes for reference?
>
> Thank in advance.


Re: Newbie Question for File Handling by wktsang1

wktsang1
Wed Feb 20 05:34:02 CST 2008

Thank Peter, the first 2 issues are solved.

For the last issue, indeed I want to do the process in Device side and do it
when the
Device connected to the Desktop via the USB cable. And I do not want to
configure the Desktop as a Web/FTP Server, any other method I can apply to
achieve the goal?

Thomas


"Peter Foot" wrote:

> There is a How To here for reading text files:-
> http://msdn2.microsoft.com/en-us/library/db5x7c0d.aspx
>
> Regarding copying it to the desktop there isn't a direct way of doing this,
> you have a couple of options:-
> If the operation is to be done from the desktop side you would use RAPI -
> OpenNETCF.Desktop.Communication provides a .NET wrapper for this
> From the device side you could use a Web Service, FTP, HTTP or a custom
> Sockets implementation to send the file.
>
> Peter
>
> --
> Peter Foot
> Microsoft Device Application Development MVP
> www.peterfoot.net | www.inthehand.com
> In The Hand Ltd - .NET Solutions for Mobility
>
> "wktsang1" <wktsang1@discussions.microsoft.com> wrote in message
> news:9E893322-9336-4537-92CF-4C9C7D614A9F@microsoft.com...
> >I would like to write an application with C# in a Windows CE 5.0 device,
> >but
> > I don't know how to read/write data from/to a ASCII file in the device,
> > and
> > how to copy such file to a PC when it is connected USB cable.
> >
> > Would anyone provide some sample codes for reference?
> >
> > Thank in advance.
>

Re: Newbie Question for File Handling by r_z_aret

r_z_aret
Wed Feb 20 14:25:48 CST 2008

Peter Foot already gave you a solid answer (I hesitate to say it's
good, because it isn't quite what you wanted, but that is not Peter's
fault). For more info, I suggest using google
(http://groups.google.com/advanced_group_search) to look up
copy file
in this newsgroup. I just did and got 652 hits. I took a quick look
and think you'll need to do a bit of wading, but even that will help
you think about alternatives.


On Tue, 19 Feb 2008 23:47:00 -0800, wktsang1
<wktsang1@discussions.microsoft.com> wrote:

>I would like to write an application with C# in a Windows CE 5.0 device, but
>I don't know how to read/write data from/to a ASCII file in the device, and
>how to copy such file to a PC when it is connected USB cable.
>
>Would anyone provide some sample codes for reference?
>
>Thank in advance.

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com