ハテナキハテナ --unics’s think/sync

福井のまんなかでぼんにょり呟く、ゆにくすの日々オボエガキなど。

Windowsのシステムフォルダパス取得方法。(C#)

Environment.SpecialFolderを使うと、Windowsのシステムフォルダ(「スタートメニュー」とか「マイドキュメント」とか)が取得できるそうですよ。

// C:\Program Files
string pfPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);

// C:\WINDOWS\System32
string sys32Path = Environment.GetFolderPath(Environment.SpecialFolder.System);

なんか使えそうなのでめもめも。
http://www.atmarkit.co.jp/fdotnet/dotnettips/032spfolder/spfolder.html

qqq for your reading!!
(c)Electro-U-nics --since 2004.03.26