我的应用程序有一小段代码,可以像这样在 C++/CX(Windows Phone 8 Interop DirectX)中读/写文件:
bool WriteState(char *fileName) {
FILE *fp = fopen(fileName);
if (fp) {
// Do save
...
fclose(fp);
return true;
}
return false;
}
和ReadState
有相同的代码。并调用(从 C# 调用):
ObjectClass game = new ObjectClass();
game.WriteState("game1.state");
在我的设备上运行没问题,调试没有报错。但是在我发布到 Windows Phone Store 并安装到我的设备后,Read/Write
代码不起作用。为什么会这样?
最佳答案
确保您没有将文件保存在其安装位置。您的应用将无法访问其在生产环境中的安装位置。您需要保存在独立的存储空间中。
关于c# - Windows Phone 8 和读/写文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26030268/