Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Save folder and files under C:\\
8 replies. Latest Post by Silverlight Web Developer on November 8, 2009.
(0)
Silverli...
Member
74 points
308 Posts
11-07-2009 5:44 PM |
I know that Silverlight has a limitation to not write and read files from C:\\ and by this use Isolated storage as I do now.
What also should work is to use Open and FileDialog.
My question is this. I recently was on a webpage where I pressed a Button. Before I did this I had to install Javascript on my computer.
When pressing this button 1 folder was created under C:\\ that consists of 10 files and a folder that also have 5 files inside.
How was this possible. Perheps there is any kind of workaround to read and write files from C:\\ without using FileDialogs ?
Fredrik N
Participant
1052 points
211 Posts
11-07-2009 5:54 PM |
There is no workaround. If a Silverlight app could just create folders and files on your disc, everyone could write apps that just removes, add virus etc to your computer.
The Button was on a normal Web page?
You mention something about installing Javascript, I guess what you did was installing something on your computer that wasn't a JavaScript (Javascript is supported by the browser, nothing that you need to install)?! Instead someone that just tricked you to make sure you installed an app that created the files on your harddrive.. So I will call that a virus.
11-07-2009 6:38 PM |
No one tricked me and this is not a virus. This is from a very large and known company.
I remove the folder that was created and then I press their button again at their webpage wich is a normal web page. When I click the button, the folder is again created with the files under C:\\
So in somehow, this is possible to do. The question is how this is possible. I dont know if Javascript had or have something to do with this. Anyway this is a possibility to do and I haven´t downloaded any install file that could have been creating this folder and files.
It comes right from that button on the webpage.
pbromberg
Contributor
2114 points
368 Posts
11-07-2009 6:59 PM |
It's possible with an ActiveX control if you approved its installation. It is not possible with Silverlight.
11-07-2009 7:04 PM |
Okay, I have to ask. I am not familiar with the ActiveX control but would it be possible to combine the ActiveX control and Silverlight and Read and Write files to C:\\ in somehow.
Is there any way to achieve this. To let a user install whatever is necessary like the ActiveX control to be able to do this ?
11-07-2009 7:49 PM |
No, it is not possible. Silverlight has no knowledge of COM and ActiveX
sl.ayer
848 points
162 Posts
11-07-2009 11:48 PM |
You could do things not permitted by Silverlight if you get user to install ActiveX control. Silverlight app would need to use javascript as a bridge to talk to ActiveX control. Of cause using ActiveX kills portability and puts use of Silverlight in question. If you have to resort to ActiveX then why not simply go with xbap?
11-08-2009 3:19 AM |
If you create or use a ActiveX which will access the local disc, you have to make sure your clients want to install that ActiveX, I would never install such AxctiveX on my computer. So It's much better if you let the users save the files by using the Save Dialog or Open to open files. If you need to store something and don't want use the Save dialog, use the IsolatedStorage, or use a Service and put the files into a database.
11-08-2009 9:17 AM |
Thanks for your answers.. The ActiveX control do sound interesting to explore. The thing is that the application is built on very much data as Gigabytes, so a database would not be possible.
For the moment I do use the Isolated Storage but are also thinking of an approach or possibitlity to also use for example: C:\\ as reading and writing this information.
I will not implement these logics for the moment but it is good to have the knowledge that this is a possibility when developing all searchpaths etc in the application.
Thanks..