find a users default save location

  • Thread starter Thread starter Marc
  • Start date Start date
M

Marc

HI,

my program needs to save and write to a file on the users machine. I
dont want to specift a particular location in case it doesnt exist.
whats the best way to search for a user default save location (i.e
documents and settings) in vb,net

Can i search the regsitry? if so whats the code for this?

Many thanks

Marc
 
I'd use one of these two:

Application.CommonAppDataPath
Application.LocalUserAppDataPath

HTH,
Tom Dacon
Dacon Software Consulting
 
Are you talking about the Application Data path or the Internet Explorer
default save location?

To get the application path:

Dim strAppPath As String =
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).ToStrin
g
MessageBox.Show(strAppPath, "Application Data Path")

To get the IE default save location, read the following registry key:

HKEY_USERS\[User's SID]Software\Microsoft\Internet Explorer\Main\Save
Directory

One more thing: SPOOF YOUR E_MAIL ADDRESS IF YOU DON'T WANT TO BE SPAMMED

I hope this helps,

Newbie Coder
 
Back
Top