Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/283.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 我可以使用WinCE 5.0从其他存储器读取数据吗?_C#_Windows Mobile_Windows Ce_.net 1.1 - Fatal编程技术网

C# 我可以使用WinCE 5.0从其他存储器读取数据吗?

C# 我可以使用WinCE 5.0从其他存储器读取数据吗?,c#,windows-mobile,windows-ce,.net-1.1,C#,Windows Mobile,Windows Ce,.net 1.1,我正在为logicpd pxa270 som卡和dotnet 1.1 sp1使用wince 5.0。当图像文件NK.bin形成并刻录到设备时,它与SOM卡的内置内存一起工作正常。假设我在闪存中有一些数据,并使用设备中的应用程序,我想读取这些数据。我该怎么办?我需要使用什么API?我是否需要在操作系统目录视图中进行一些更改 好的,我得到了答案。下面的代码片段工作正常。假设您正在使用移动设备和SOM卡的内存。如果设备的外部闪存中有一个文件,并且该文件位于名为“myFolder”的文件夹中,则以下代码

我正在为logicpd pxa270 som卡和dotnet 1.1 sp1使用wince 5.0。当图像文件NK.bin形成并刻录到设备时,它与SOM卡的内置内存一起工作正常。假设我在闪存中有一些数据,并使用设备中的应用程序,我想读取这些数据。我该怎么办?我需要使用什么API?我是否需要在操作系统目录视图中进行一些更改

好的,我得到了答案。下面的代码片段工作正常。假设您正在使用移动设备和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。另外,检查可能对你有用。我从这里得到了帮助。但它不起作用。基本上我想用一些简单的东西。SOM卡的内存将从连接到板的闪存中读取。这就是问题所在。您认为使用StreamReader这样简单的工具仍然可以解决问题吗?