Click here to Skip to main content
15,889,723 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

C#
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();

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



Thanks
Posted
Updated 8-Jan-12 19:24pm
v3

1 solution

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.
 
Share this answer
 
Comments
Manish Kumar Namdev 9-Jan-12 1:12am    
Abhinav many thanks for reply..
I checked in cookies,temp and in application data in my documents and settings but still not getting where is this folder exists.

And you mentioned sandboxed environment. I couldn't catch it can you please put some light on this.
Abhinav S 9-Jan-12 9:53am    
This good link http://msdn.microsoft.com/en-us/magazine/dd458794.aspx should give you an idea about where isolated storage is actually located. However, you should really not need to worry about its location and use it using the API.
Manish Kumar Namdev 10-Jan-12 2:21am    
Thanks abhinav... I also read in some other articles that there is no need to worry about the location. But this morning when I run my application again then it shown me an error "Not Enough Space".
Now I have set the "Qutta" for the IsolatedStorageFile object and deleting the previous file if exists.
As the requirement in my application it can work. And I thinking giving a fixed amount of space can be a problem again.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900