在Silverlight中使用IsolatedStorage创建文件夹 [英] Create Folders using IsolatedStorage in Silverlight

查看:126
本文介绍了在Silverlight中使用IsolatedStorage创建文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,我在asp.net应用程序中使用Silverlight.
我正在尝试使用IsolatedStorageFile在本地硬盘驱动器"D"中创建一个文件夹.

当我仅给出目录名称但不知道它存在的位置时,它正在创建目录.

而且,当我给出完整的路径"D:/Manish/ManishNewFolder"时,它将引发错误无法创建目录.

Hello Friends I''m using Silverlight in my asp.net application.
I''m trying to create a folder in my local hard drive "D" using IsolatedStorageFile.

It is creating the directory when I give only Directory Name but I''m not getting where it exists.

And, when I give complete path "D:/Manish/ManishNewFolder" then it is raising an error Unable to create a directory.

string fileName = "D:/ManishNewFolder";

var store = IsolatedStorageFile.GetUserStoreForApplication();
if (!store.DirectoryExists(fileName))
{
   store.CreateDirectory(fileName);
}
var isoStream = store.OpenFile(fileName + @"/myvoice.wav", FileMode.OpenOrCreate);
isoStream.Close();
store.Dispose();


请指导我.我想在本地驱动器"D"中创建驱动器.



谢谢


Please guide me. I want to make a drive in my local drive "D".



Thanks

推荐答案

这些文件夹是在临时存储位置(如cookie)中创建的.

您不能直接在Silverlight中访问硬盘驱动器路径(除非您以提升的权限运行).
这就是在沙盒环境中运行Silverlight的全部想法.
These folders are created in a temporary storage location (like a cookie).

You cannot directly access the harddrive path in Silverlight (unless you run with elevated permissions).
That is the whole idea behind running Silverlight in a sandboxed environment.


这篇关于在Silverlight中使用IsolatedStorage创建文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆