开发者

UnauthorizedAccessException when deleting windows mobile shortcut

开发者 https://www.devze.com 2022-12-13 22:45 出处:网络
I need to create a utility program which runs on windows mobile. I need to have the .cab file install the program and a shortcut to \\Windows\\Start Menu\\Programs. The user launches the program with

I need to create a utility program which runs on windows mobile. I need to have the .cab file install the program and a shortcut to \Windows\Start Menu\Programs. The user launches the program with this shortcut. I then need to delete the shortcut after the application has been run the first time.

I'm currently getting an UnauthorizedAccessException. I thought maybe the shortcut was locked while the program was running however I can go delete the file using file explorer while the program is still running. Has anyone run into this or t开发者_开发技巧hink of a work around?

Thanks!


Using the FileInfo object I was able to see the attributes on the file. The attributes were set to ReadOnly. After setting the attributes to Normal i was able to delete the file.

0

精彩评论

暂无评论...
验证码 换一张
取 消