Is it never possible to get the FullName from a file using Silverlight OpenFileDialog?

前端 未结 4 1802
闹比i
闹比i 2021-01-24 07:57

I want to get the fullname from a file on Silverlight OpenFileDialog, when I try that, Silverlight throws me an error.

I saw there is an attribute on FullName saying it

4条回答
  •  无人共我
    2021-01-24 08:14

    The Silverlight OpenFileDialog behaves differently to the standard forms OFD for security reasons. If you retrieve the SelectedFile, it actually returns a FileDialogFileInfo object which contains the Name of the file, rather than a path to the file. When you think about it, this makes perfect sense - you don't want somebody writing a piece of malicious code that can get a handle into your filesystem.

提交回复
热议问题