Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Basic how to get to %appdata%

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.

like image 446
Matthewj Avatar asked Jul 10 '26 09:07

Matthewj


1 Answers

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.

like image 125
ckittel Avatar answered Jul 14 '26 11:07

ckittel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!