gpt4 book ai didi

c# - 不允许在 IsolatedStorageFileStream 上对隔离存储中的 CreateFile 进行操作

转载 作者:太空狗 更新时间:2023-10-29 21:45:39 25 4
gpt4 key购买 nike

我正在尝试使用以下代码在隔离存储中创建一个文件,

IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication();
storageFile.CreateFile("Html\\index.html");

但是我在做同样的事情时遇到异常..这说。

System.IO.IsolatedStorage.IsolatedStorageException: Operation not permitted on IsolatedStorageFileStream

除此操作外没有执行任何操作。

最佳答案

您可能需要先创建Html 目录。作为IsolatedStorageFile.CreateDirectory()如果目录已经存在就会成功,你可以这样做

IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication();
storageFile.CreateDirectory("Html");
storageFile.CreateFile("Html\\index.html");

关于c# - 不允许在 IsolatedStorageFileStream 上对隔离存储中的 CreateFile 进行操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13841364/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com