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

前端 未结 4 1803
闹比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:16

    OpenFileDialog won't provide the full name simply because it doesn't want you to alter those files. With Silverlight, you only have access to the isolated storage and the file could be located outside this storage. But you could just open the file and copy it to the isolated storage, and modify it there.
    Just discovered that bassfriend found this link too and posted it above. My mistake. Then again, the link is in the top-20 of Google. :-)

    Another reason why you won't get the full filename is because that filename could contain sensitive information. For example, a file in the "My Documents" folder could expose the user login name.

    Basically, it's a security restriction. You're not supposed to bypass it, even if it would be possible. If you would find a way around this, MS would probably release a security update to close that leak again...

提交回复
热议问题