좋아, 대답 해. 다음 코드 스 니펫이 올바르게 작동합니다. 모바일 장치와 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 Framework를 사용하지 않습니까? 그에 대한? 뭔가 'StreamReader'처럼 간단합니다. 또한 http://www.opennetcf.org/Products/SmartDeviceFramework.aspx가 유용 할 수 있는지 확인하십시오. – Jeremy
여기에서 도움을 받았습니다. 하지만 그것은 작동하지 않습니다 http://stackoverflow.com/questions/40269/finding-the-storage-card-path-on-wm6. 기본적으로 나는 간단한 것을 사용하고 싶다. SOM 카드의 메모리는 보드에 연결된 플래시 메모리에서 읽습니다. 그게 문제 야. StreamReader와 같은 간단한 것을 사용하여 문제가 해결된다고 생각합니까? –