我正在尝试在hololens上创建一个应用程序,用于创建和写入文本文件以记录用户的输入.目前,我一直试图制作文件并从文件资源管理器或一个驱动器访问它.这是我的方法:
public void createFile()
{
#if WINDOWS_UWP
Task task = new Task(
async () =>
{
testText.text="hi";
StorageFolder storageFolder = ApplicationData.Current.LocalFolder;
StorageFile textFileForWrite = await storageFolder.CreateFileAsync("Myfile.txt");
});
task.Start();
task.Wait();
#endif
}
Run Code Online (Sandbox Code Playgroud)
这基本上就是我在这里找到的:https://forums.hololens.com/discussion/1862/how-to-deploy-and-read-data-file-with-app,但当我尝试运行该方法时,应用程序在hololens冻结一点然后关闭.代码有问题吗?知道发生了什么事吗?提前致谢