2

I'm working on a project in Visual Basic and it's going to store all the data in a folder in %appdata%. I'm using Visual Studio 2010 I already tried this:

My.Computer.FileSystem.CreateDirectory(Environment.ExpandEnvironmentVariables(%AppData%\test"))

but it didn't work.

ckittel
  • 6,478
  • 3
  • 41
  • 71
Matthewj
  • 1,932
  • 6
  • 26
  • 37

2 Answers2

7

Using VB.NET, you can find them conveniently located in the My namespace at:

My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData
My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData

Check out the MSDN documentation for more paths.

ckittel
  • 6,478
  • 3
  • 41
  • 71
5
Dim filePath As String

filePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\test"
Allen Gammel
  • 396
  • 2
  • 4