2011-08-24 10 views
2

Visual Basic에서 프로젝트를 작업 중이며 폴더의 모든 데이터를 %appdata%에 저장하려고합니다. 저는 Visual Studio 2010을 사용하고 있습니다. 이미 시도해 보았습니다.Visual Basic 방법 % appdata %

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

그러나 작동하지 않았습니다.

답변

5
Dim filePath As String 

filePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\test" 
7

VB.NET을 사용하여, 당신은 그 편리에 My 네임 스페이스에 위치한 찾을 수 있습니다

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

확인 더 많은 경로에 대한 MSDN documentation.