views:

52

answers:

1

I have seen OpenFileDialog and SaveFileDialog in silverlight but, what if I required to select path of folder in my computer?

Scenario: The user want to select path in the Computer which he can use for his files. For example there is a button (e.g. Select path to save your work button) which he will use to browse folder. When he is done with selection the path should return to the textbox or similar.

+1  A: 

Silverlight does not let you know anything about a selected file either (just access it as a file stream).

Letting you know the file's path would be considered another security hole, so it is not allowed. Sorry.

The only folders you can use are in Isolated storage, so you may want to put all your user files there instead. That way you can provide a tree display of files and folders (you will have to obtain, or write, that file/folder selection code of course).

Enough already
So this means it will not be allowed for any user to read string of path of their local computer's folder (e.g C:\MyFiles\thisFolder) using openfiledialog?I need to know only folder's Path name as another external dlls will then get that input string for further file handling operation.
webKite
That is correct. If you use a debugger to look at the filestream object returned from FileOpenDialog you will find all details of the file have been stripped out. To allow it would make it a possible security hole (and MS need to ensure Silverlight is always "100% safe"). Sorry.
Enough already