[RESOLVED] [2005] deleting
right now, im using Windows Vista..
in Windows XP, deleting a file is working with this code
Code:
System.IO.File.Delete("C:\testdelete.jpg")
But in Windows Vista, i encounter this message: Access to the path 'C:\testdelete.jpg' is denied.
why its happening? what is the solution for this?
Re: [RESOLVED] [2005] deleting
Not sure about VB.2005, however in 2008, Right click the project in the Solutions Explorer, and select Properties. From Application tab in that window you can select 'View UAC Settings'.
As mentioned in the post I deleted, you probably are better off installing to the appropriate location for any OS situation.
Re: [RESOLVED] [2005] deleting
You're writing to a directory that requires administrator access. This is unadvised unless you're developing a system utility that needs to access restricted folders. Instead, you should be writing to only user directories. There are temporary folders just for temporary data (which is what you appear to be deleting).
Re: [RESOLVED] [2005] deleting
Even though XP will allow you access to various places that Vista won't, that doesn't mean that you should use them. You should generally only be using folders that you can access through Environment.GetFolderPath or My.Computer.FileSystem.SpecialDirectories. That gives you access to the Temp folder, My Documents, My Pictures, Application Data and the like. Those are really the only places that your application should need access to in the vast majority of cases.