Vista UAC, Access Elevation and .Net

后端 未结 6 925
死守一世寂寞
死守一世寂寞 2020-12-10 18:18

I\'m trying to find out if there is any way to elevate a specific function within an application. For example, I have an app with system and user settings that are stored in

6条回答
  •  再見小時候
    2020-12-10 18:38

    The Windows SDK "Cross Technology Samples" have a "UACDemo" application which shows examples of a C# Windows Forms application which launches an administrator process to perform a task which requires elevation (i.e. writing to %programfiles%).

    This is a great starting point for writing your own functionality. I've extended this sample to use .Net Remoting and IPC to call between my normal user process and my elevated process which allows me to keep the elevation executable generic and implement application-specific code within the application.

提交回复
热议问题