Reputation: 42450
I've just started learning Silverlight and I learned it is a client side program. Suppose I write a Silverlight app and add it to a webpage which is hosted on my desktop. If in the code-behind, I iterate through all the files in C:\StackOverflow and display the results on the page, when a user visits the page from another computer, will the program look for C:\StackOverflow on his computer, and not mine?
Upvotes: 1
Views: 123
Reputation: 653
Be aware to don't confuse ASPX code-behind and XAML code-behind. The first one executes on the server (and in your case, if correct privileges are granted, will show files on your computer). The second one executes on the client, AFTER the download of the applet. Unfortunatly it can't list such folder, because of security resctrictions.
Upvotes: 1
Reputation: 588
usually the Silverlight application will be hosted on some server.. you can send to the client data from the server and you can access your own folders through the server (if it's on your computer)
Upvotes: 1
Reputation: 24723
You don't have access to the local file system directly within a Silverlight application since the application could compromise the system; it is abstracted away.
An OOB Silverlight application has increased trust but still does not provide complete access to the file system as would a WinForms or WPF application.
Upvotes: 1
Reputation: 15268
That's correct, the Silverlight content is executed on the client computer.
However you wouldn't be able to access C:\StackOverflow because the plugin is sandboxed for obvious security reasons.
Upvotes: 2