locked
How to give path in windows mobile 6.0 apps? RRS feed

  • Question

  • Hi

    can u pls tell me how to give path in windows mobile 6.0.

    i'm placing images in one floder.how to access the particular images in windows mobile 6.0.

    can u pls tell how to give path.

    Wednesday, September 8, 2010 10:16 AM

Answers

  • Hi,

    if that folder is your application folder i.e the folder in which your application is there then use this

    string _appFolder = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase).Replace(@"file:\", "");

    _appFolder  = _appFolder + @"\Sounds\xyz.wav";

     

    or if it  is in any other directory then use like way mentioned below

    "\"" + "Windows\\XYZ\\XYZ.wav" + "\""

                         OR

    @"\Windows\XYZ\Sounds\xyz.wav"

    • Marked as answer by warrentang Friday, September 10, 2010 3:53 AM
    Thursday, September 9, 2010 8:03 AM

All replies

  • You can usually use the relative path or absolute path starting from root(\) For example you can use

    \Program Files\My Program\Images\Picture.jpg

    Wednesday, September 8, 2010 10:45 AM
  • Hi,

    if that folder is your application folder i.e the folder in which your application is there then use this

    string _appFolder = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase).Replace(@"file:\", "");

    _appFolder  = _appFolder + @"\Sounds\xyz.wav";

     

    or if it  is in any other directory then use like way mentioned below

    "\"" + "Windows\\XYZ\\XYZ.wav" + "\""

                         OR

    @"\Windows\XYZ\Sounds\xyz.wav"

    • Marked as answer by warrentang Friday, September 10, 2010 3:53 AM
    Thursday, September 9, 2010 8:03 AM
  • On Wed, 8 Sep 2010 10:45:57 +0000, ysivaram wrote:

    You can usually use the relative path or absolute path starting from root(\) For example you can use

    Windows CE (and thus platforms like Windows Mobile based on it)
    supports only absolute path.


    \Program Files\My Program\Images\Picture.jpg

    Thursday, September 9, 2010 2:45 PM
  • You are absolutely right Bob. Sorry about that.

    Like Rahul suggested get the executing assembly and prefix it with the relative path.

    Friday, September 10, 2010 12:12 AM