2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

特殊フォルダパスの列挙2

Posted at

■ サンプルコード

Console.WriteLine("{0}: {1}", Environment.DirectoryAlarms, Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryAlarms).Path);
Console.WriteLine("{0}: {1}", Environment.DirectoryDcim, Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDcim).Path);
Console.WriteLine("{0}: {1}", Environment.DirectoryDocuments, Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDocuments).Path);
Console.WriteLine("{0}: {1}", Environment.DirectoryDownloads, Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDownloads).Path);
Console.WriteLine("{0}: {1}", Environment.DirectoryMovies, Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryMovies).Path);
Console.WriteLine("{0}: {1}", Environment.DirectoryMusic, Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryMusic).Path);
Console.WriteLine("{0}: {1}", Environment.DirectoryNotifications, Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryNotifications.Path);
Console.WriteLine("{0}: {1}", Environment.DirectoryPictures, Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryPictures).Path);
Console.WriteLine("{0}: {1}", Environment.DirectoryPodcasts, Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryPodcasts).Path);
Console.WriteLine("{0}: {1}", Environment.DirectoryRingtones, Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryRingtones).Path);

■ 結果

Alarms: /storage/emulated/0/Alarms
Documents: /storage/emulated/0/Documents
Download: /storage/emulated/0/Download
Movies: /storage/emulated/0/Movies
Music: /storage/emulated/0/Music
Notifications: /storage/emulated/0/Notifications
Pictures: /storage/emulated/0/Pictures
Podcasts: /storage/emulated/0/Podcasts
Ringtones: /storage/emulated/0/Ringtones

■ サンプルコード

Console.WriteLine("{0}: {1}", "RootDirectory", Environment.RootDirectory.Path);
Console.WriteLine("{0}: {1}", "DataDirectory", Environment.DataDirectory.Path);
Console.WriteLine("{0}: {1}", "DownloadCacheDirectory", Environment.DownloadCacheDirectory.Path);
Console.WriteLine("{0}: {1}", "ExternalStorageDirectory", Environment.ExternalStorageDirectory.Path);

■ 結果

RootDirectory: /system
DataDirectory: /data
DownloadCacheDirectory: /cache
ExternalStorageDirectory: /storage/emulated/0

■ サンプルコード

Console.WriteLine("{0}: {1}", "ExternalStorageState", Environment.ExternalStorageState);
Console.WriteLine("{0}: {1}", "IsExternalStorageEmulated", Environment.IsExternalStorageEmulated);
Console.WriteLine("{0}: {1}", "IsExternalStorageRemovable", Environment.IsExternalStorageRemovable);

■ 結果

ExternalStorageState: mounted
IsExternalStorageEmulated: true
IsExternalStorageRemovable: false

■ using

using Android.OS;
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?