For Programmers: Free Programming Magazines  


Home > Archive > Smartphone Developer Forum > January 2006 > String in smartphone









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author String in smartphone
Cleyton

2006-01-30, 7:05 pm

Hello!

Well, I'm trying to do an application to smartphone in the VS 2005 that
changes an image from a picture box every time that you click in the menu.
I'm getting the image in the directory of application:

string path = @" c:\temp\DeviceApplication3\DeviceApplica
tion3\1.bmp";
Image img = new Bitmap(path);

I put the "@" before like I do in the Win App, but in all places that has
"\" is coming "\\", so, the string be like this:

path : @" c:\\temp\\DeviceApplication3\\DeviceAppl
ication3\\1.bmp";

I've tried other experiment, but i didn't get. Someone knows why this is
happening e how can i resolve??

Thanx!
Ilya Tumanov [MS]

2006-01-30, 7:05 pm

First of all, Windows CE does not have drive letters and does not support
relative paths.



As to slashes, you either use verbatim strings with @ and get your string
exactly as you typed it or you do not use @ and escape special characters
like using '\' to get '' in actual string.



For example, the following strings are the same and represent correct path
on CE:



string foo = "\\Program Files\\My Application\\app.exe";



string bar = @"\Program Files\My Application\app.exe";



--
Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group...framework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).

"Cleyton" <Cleyton@discussions.microsoft.com> wrote in message
news:D43F3CB0-792E-4AAF-AAD4-49DC399DAF9D@microsoft.com...
> Hello!
>
> Well, I'm trying to do an application to smartphone in the VS 2005 that
> changes an image from a picture box every time that you click in the menu.
> I'm getting the image in the directory of application:
>
> string path = @" c:\temp\DeviceApplication3\DeviceApplica
tion3\1.bmp";
> Image img = new Bitmap(path);
>
> I put the "@" before like I do in the Win App, but in all places that has
> "\" is coming "\\", so, the string be like this:
>
> path : @" c:\\temp\\DeviceApplication3\\DeviceAppl
ication3\\1.bmp";
>
> I've tried other experiment, but i didn't get. Someone knows why this is
> happening e how can i resolve??
>
> Thanx!



MSenne

2006-01-31, 7:08 pm

If you are doing an image browser then what you are doing is certainly
fine, but if you are dealing with a specific set of images you should
check the MSDN Library for information on using "embedded resources".
If that is what you want to do then you can skip the whole disk path
problem and get into a whole new world of problems with embedded
resource paths ;-)
-MSenne

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com