[英]Visual Basic how to get to %appdata%
我正在使用Visual Basic中的一個項目,它將所有數據存儲在%appdata%
的文件夾中。 我正在使用Visual Studio 2010我已經嘗試過這個:
My.Computer.FileSystem.CreateDirectory(Environment.ExpandEnvironmentVariables(%AppData%\test"))
但它不起作用。
使用VB.NET,您可以在My
命名空間中找到它們:
My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData
My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData
查看MSDN文檔以獲取更多路徑。
Dim filePath As String
filePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\test"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.