iT邦幫忙

DAY 12
1

C# 程式學習系列 第 12

C# 取得[我的文件]資料夾位置

c#

想要取得系統特殊資料夾目錄路徑,可以透過Environment.SpecialFolder
想要取得系統特殊資料夾目錄路徑,可以透過Environment.SpecialFolder,
http://msdn.microsoft.com/zh-tw/library/system.environment.specialfolder.aspx
例如我們要取得我的文件資料夾位置,可以

string MyDocumentsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); 
MessageBox.Show(MyDocumentsPath);

取得System 目錄,可以

string SystemPath = Environment.GetFolderPath(Environment.SpecialFolder.System); 
MessageBox.Show(SystemPath);

上一篇
C# 使用 RegularExpressions 搜尋指定字串的位置
下一篇
C# TextBox 如何自動捲動到底部
系列文
C# 程式學習30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言