use*_*772 6 c# isolatedstorage isolatedstoragefile windows-phone windows-phone-8
我正在尝试使用以下代码在隔离存储中创建一个文件,
IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication();
storageFile.CreateFile("Html\\index.html");
Run Code Online (Sandbox Code Playgroud)
但是我在做同样的事情时会遇到异常.
System.IO.IsolatedStorage.IsolatedStorageException:IsolatedStorageFileStream上不允许操作
除此操作外,不执行任何操作.
您可能需要Html先创建目录。因为如果目录已经存在,IsolatedStorageFile.CreateDirectory()就会成功,所以你可以这样做
IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication();
storageFile.CreateDirectory("Html");
storageFile.CreateFile("Html\\index.html");Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3189 次 |
| 最近记录: |