Compact framework equivalent for Application.LocalUserAppDataPath

  • Thread starter Thread starter Gilles Kohl [MVP]
  • Start date Start date
G

Gilles Kohl [MVP]

Dear All,

Trying to get my feet wet with the CF 2.0. I'm attempting to use a
persistance utility I wrote for the full framework, and am getting
error messages for Application.LocalUserAppDataPath which apparently
is not supported in the CF (actually, not much of the Application
class seems to be).

So the question is: what is the politically correct way for a CF app
to determine where to store its files?

Wasn't able to find anything relevant via a Google search on
"LocalUserAppDataPath compact framework" , unfortunately.

Thanks in advance for your help,

Regards,
Gilles.
 
Simon,

I tend to use my local base directory for application config files/data etc
and use \My Documents for user files/databses etc.
Microsoft do not recommend using the \Windows directory for anything other
than help files.

See
http://download.microsoft.com/downl...5-0172c2638686/ppc_handbook_may2004_final.pdf
for Microsoft's recommdendations on developing Pocket PC applications.

Thanks for a quick response indeed and for that reference -
interesting and useful document.

However it doesn't seem to address the CF - how do you retrieve e.g.
your "\My Documents" folder in a _managed_ application?

Or is it common practice to simply hard-code that path?

Regards,
Gilles.
 
Gilles said:
So the question is: what is the politically correct way for a CF app
to determine where to store its files?

Wasn't able to find anything relevant via a Google search on
"LocalUserAppDataPath compact framework" , unfortunately.

Have you tried:
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

--
John T
http://tknowlogy.com/TknoFlyer
http://www.pocketgear.com/products_search.asp?developerid=4415
Reduce spam. Use Sender Policy Framework: http://spf.pobox.com
____________________
 
John,

Have you tried:
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

Thanks - works like a charm on the target device, just like
SpecialFolder.Personal does. (The first one throws an InvalidOperation
Exception on the Pocket PC 2003 Emulator though)

Regards,
Gilles.
 
Back
Top