Um mittels VB.NET auf spezielle Windows System Verzeichnisse zugreifen zu können, kann der folgende Code eingefügt werden:
String PersonalFolder = Environment.GetFolderPath(Environment.SpecialFolder.Personal); Hierbei steht Personal für den Dokumente Ordner. Weitere verfügbare Variablen und deren Bedeutung:
Environment.SpecialFolder.ApplicationData
Environment.SpecialFolder.System
Environment.SpecialFolder.CommonApplicationData
Environment.SpecialFolder.CommonProgramFiles
Environment.SpecialFolder.Cookies
Environment.SpecialFolder.Desktop
Environment.SpecialFolder.DesktopDirectory
Environment.SpecialFolder.Favorites
Environment.SpecialFolder.History
Environment.SpecialFolder.InternetCache
Environment.SpecialFolder.LocalApplicationData
Environment.SpecialFolder.MyComputer
Environment.SpecialFolder.MyMusic
Environment.SpecialFolder.MyPictures
Environment.SpecialFolder.Personal
Environment.SpecialFolder.ProgramFiles
Environment.SpecialFolder.Programs
Environment.SpecialFolder.Recent
Environment.SpecialFolder.SendTo
Environment.SpecialFolder.StartMenu
Bedeutung:
0 Desktop C:\Documents and Settings\RB\Desktop
2 Programs C:\Documents and Settings\RB\Start Menu\Programs
5 Personal D:\documents
6 Favorites C:\Documents and Settings\RB\Favorites
8 Recent C:\Documents and Settings\RB\Recent
9 SendTo C:\Documents and Settings\RB\SendTo
11 StartMenu C:\Documents and Settings\RB\Start Menu
13 MyMusic D:\documents\My Music
16 DesktopDirectory C:\Documents and Settings\RB\Desktop
17 MyComputer
26 ApplicationData C:\Documents and Settings\RB\Application Data
28 LocalApplicationData C:\Documents and Settings\RB\Local Settings\Application Data
32 InternetCache C:\Documents and Settings\RB\Local Settings\Temporary Internet Files
33 Cookies C:\Documents and Settings\RB\Cookies
34 History C:\Documents and Settings\RB\Local Settings\History
35 CommonApplicationData C:\Documents and Settings\All Users\Application Data
37 System C:\WINDOWS\System32
38 ProgramFiles C:\Program Files
39 MyPictures D:\documents\My Pictures
43 CommonProgramFiles C:\Program FilesCommon Files