i have developed a win application with c# which generate file in a folder in c:\ drive. when try to generate file there then problem occur for permission issue but when the application generate file in other drive than C:\ then no problem occur. so when i will distribute my apps setup to end user then i wont be sure that user who will install my apps does has the permission to generate file in C:\ drive.
so guide me how can i overcome this issue. should i Using Manifests to Elevate an application in win OS?
i got some article
http://blogs.msdn.com/b/nikhiln/archive/2007/04/19/embed-a-manifest-to-make-an-application-elevate-in-vista.aspx
http://www.codeproject.com/Articles/105506/Getting-Elevated-Privileges-on-Demand-using-C
http://archive.msdn.microsoft.com/KB981778
etc......please guide me with right knowledge. thanks
You can start your application again with elevated permission and have some check at the application's start to see if this is the case. Here's an example: (Be careful not to get into an endless loop of the application starting itself.)
I agree, though, that storing information in "C:" is probably not a good idea. You can try someplace like:
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
.