UnauthorizedAccessException when deleting windows mobile shortcut
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.
精彩评论