Compact framework equivalent for Application.LocalUserAppDataPath

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.
 
G

Gilles Kohl [MVP]

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.
 
J

John T

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
____________________
 
G

Gilles Kohl [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top