简体   繁体   中英

Can a file be opened simultaneously under SIlverlight and Windows?

Silverlight uses an IsolatedStorageFileStream to open files.

I am trying to determine if I need to watch for locking issues when opening a file in Silverlight. In other words, can a file be opened by Silverlight and some other Windows (let's say W7) application at the same time.

If so, any ideas on how to handle locking?

Technically, yes, an unmanaged app can access any file. The odds that such an app would just happen to open the file exclusively and lock you out are however vanishingly small. The directories containing isolated storage files are not found by accident.

Don't discount the possibility that it is another instance of your Silverlight app that has the file opened, that's far more likely. Having a reasonable failure mode for an IOException is always a good idea. A "sorry, couldn't do it" message is acceptable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM