[Tips][パス操作] 一時フォルダーのパスを取得する

スポンサーリンク

一時フォルダーのパスを取得するには、PathクラスGetTempPathメソッドを使用します。

GetTempPathメソッドは現在のユーザーの一時フォルダーのパス文字列を返します。

下記は一時フォルダーを取得する例です。

VBの例

'一時フォルダーのパスを取得する
Dim tmpPath As String = IO.Path.GetTempPath()

MessageBox.Show(tmpPath)

C#の例

// 一時フォルダーのパスを取得する
string tmpPath = System.IO.Path.GetTempPath();

MessageBox.Show(tmpPath);
Please follow and like us:

コメント

タイトルとURLをコピーしました