私は答えを得ました。次のコードスニペットは正常に動作します。モバイルデバイスとSOMカードのメモリを使用しているとします。デバイスの外部フラッシュメモリにファイルがあり、そのファイルが 'myFolder'という名前のフォルダにある場合、次のコードスニペットは '\ myFolder'を返します。
public static string GetStorageCard()
{
//initialize the path as an empty string
string firstCard = "";
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo("\\");
System.IO.FileSystemInfo[] fsi = di.GetFileSystemInfos();
//iterate through them
for (int x = 0; x < fsi.Length; x++)
{
//check to see if this is a temporary storage card (e.g. SD card)
if ((fsi[x].Attributes & System.IO.FileAttributes.Temporary) == System.IO.FileAttributes.Temporary)
{
//if so, return the path
firstCard = fsi[x].FullName;
}
}
return firstCard;
}
.NETフレームワークそれは? 'StreamReader'のような単純なものです。また、http://www.opennetcf.org/Products/SmartDeviceFramework.aspxが役に立つかもしれないかどうかをチェックしてください。 – Jeremy
私はここから助けを得ている。しかし、それは動作しませんhttp://stackoverflow.com/questions/40269/finding-the-storage-card-path-on-wm6。基本的に私は単純なものを使いたい。 SOMカードのメモリはボードに接続されたフラッシュメモリから読み込まれます。それは問題だ。 StreamReaderのような単純なものを使っても問題は解決すると思いますか? –