C# 如何在运行Windows 10 IoT的raspberry pi上上载和读取文件

C# 如何在运行Windows 10 IoT的raspberry pi上上载和读取文件,c#,raspberry-pi3,windows-10-iot-core,C#,Raspberry Pi3,Windows 10 Iot Core,我构建了一个应用程序,可以读取配置文件并加载基于xml的词典。 我想要的是不需要将该文件添加到程序中。相反,我希望能够上传到pi3,然后告诉程序刷新并读取我上传的文件。它将代码中包含的文件加载到一个模糊的文件夹中。 如何将代码中的路径上载并指定到更容易访问的文件夹中 提前感谢使用Windows.Storage名称空间,并遵循以下代码在UWP上的文件夹和文件中创建、访问和其他类似操作 //Get Installation Folder for current applica

我构建了一个应用程序,可以读取配置文件并加载基于xml的词典。 我想要的是不需要将该文件添加到程序中。相反,我希望能够上传到pi3,然后告诉程序刷新并读取我上传的文件。它将代码中包含的文件加载到一个模糊的文件夹中。
如何将代码中的路径上载并指定到更容易访问的文件夹中


提前感谢

使用Windows.Storage名称空间,并遵循以下代码在UWP上的文件夹和文件中创建、访问和其他类似操作

            //Get Installation Folder for current application
            StorageFolder rootFolder = ApplicationData.Current.LocalFolder;

            //Create a folder in the root folder of app if not exist and open if exist.
            StorageFolder Folder = await rootFolder.CreateFolderAsync(yourFolderName, CreationCollisionOption.OpenIfExists);

            //Craete a file in your folder if not exist and replace it with new file if exist
            StorageFile sampleFile = await Folder.CreateFileAsync("samplefile.xml", CreationCollisionOption.ReplaceExisting);

            //Create your text and write it on your configuaration file
            string yourText = "Your Sample Text or Configuration";
            await Windows.Storage.FileIO.WriteTextAsync(sampleFile, yourText);
之后,您可以再次访问该文件,并从该表单ReadTextAsync方法读取配置值

            //Read data from file
            await Windows.Storage.FileIO.ReadTextAsync(sampleFile);

我们有一个专门的树莓皮堆栈交换-尝试张贴您的问题,谢谢。我会这样做的,你可以检查并输入UWP。