Code Comments
Programming Forum and web based access to our favorite programming groups.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!
Post Follow-up to this messageFirst 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... /> work?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!
Post Follow-up to this messageIf 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
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.