Chris
Tue Apr 29 13:35:53 CDT 2008
Of course that doesn't work. There is no "C" drive on the CE device. The
emulator can be imagined as a completely separate physical device. It knows
nothing about the host PC or it's file system, just as the PC knows nothing
about the emulator and its file system. If you want to open a file, you
open it "locally" on the emulator. By adding it to the project as Content
and selecting "copy", Studio pushed it down to the device with the
application. Use the file browser on the emulator and you can find it (and
its path).
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
"Nina" <Nina@discussions.microsoft.com> wrote in message
news:CD876C31-E7D0-41BA-A3C7-C2DE81FCEAB0@microsoft.com...
>I tryed full Path where project located and it doesn't work:
>
> If File.Exists("C:\Nina\Newton\Demo1.0.1\Data\Config.dat") = True Then
> MessageBox.Show("File Found")
> Else
> MessageBox.Show("File Not Found")
> End If
>
> Please, any ideas how to make it work. Thank you.
>
> "Chris Tacke, eMVP" wrote:
>
>> Windows CE has no concept of a current directory, so relative paths
>> cannot
>> be used. Use a fully-qualified path.
>>
>> --
>>
>> Chris Tacke, Embedded MVP
>> OpenNETCF Consulting
>> Giving back to the embedded community
>>
http://community.OpenNETCF.com
>>
>>
>>
>> "Nina" <Nina@discussions.microsoft.com> wrote in message
>> news:1379DD4E-489D-47DD-9EF4-057C4C2115EB@microsoft.com...
>> > Thank you, Ginny
>> >
>> > In project I added folder "Data" with "Config.dat" file. I changed
>> > property
>> > of Config.dat file to Content and property of "Copy to Output" to "Copy
>> > always".
>> >
>> > Now from the code I try to access that file:
>> >
>> > If File.Exists(".\Data\Config.dat") = True Then
>> > MessageBox.Show("File Found")
>> > Else
>> > MessageBox.Show("File Not Found")
>> > End If
>> >
>> > I got "File Not Found".
>> > Do I need change Settings for the Emulator? If yes, what it should be?
>> > Thank you, Nina
>> >
>> >
>> > "Ginny Caughey MVP" wrote:
>> >
>> >> Nina,
>> >>
>> >> Usually the easiest way to get test data onto an emulator is to deploy
>> >> it
>> >> along with your app into the app's folder. You just add the data to
>> >> your
>> >> project in VS and set its build property to Content.
>> >>
>> >> Ginny
>> >>
>> >> "Nina" <Nina@discussions.microsoft.com> wrote in message
>> >> news:172C4D19-1A8E-466D-AD66-3FC12B3A719F@microsoft.com...
>> >> > Right now I don't have actual Mobile device and I try to run my
>> >> > project
>> >> > from
>> >> > Visual Studio 2005 using Mobile 6 Professional Emulator. However,
>> >> > Emulator
>> >> > cannot see files on my local PC. Do I have to create a Storage Card?
>> >> > I
>> >> > added
>> >> > files to my project. How can I access them? Thanks a lot.
>> >>
>> >> --
>> >>
>> >> Ginny Caughey
>> >> Device Application Development MVP
>> >>
>> >> www.wasteworks.com
>> >> Software for Waste Management
>> >>
>> >>
>> >>
>>
>>
>>