繁体   English   中英

Windows Phone 8和读/写文件

[英]Windows Phone 8 and read/write file

我的应用程序中有一小段代码可以像这样在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代码不起作用。 为什么会这样?

确保您没有将文件保存在其安装位置。 您的应用无法在生产环境中访问其安装位置。 您需要保存在隔离的存储中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM