Toggle navigation
VA伐木累
社区
VA伐木累
Proxy
JSON
BASE64
MyGit
登录
注册
×
登录
邮箱
密码
忘记密码?
C#管理员权限运行
•发布于
•作者
liuzy
•1557 次浏览
•来自
资讯
- `Program.cs` ``` System.Security.Principal.WindowsIdentity identity = System.Security.Principal.WindowsIdentity.GetCurrent(); System.Security.Principal.WindowsPrincipal principal = new System.Security.Principal.WindowsPrincipal(identity); if (!principal.IsInRole(System.Security.Principal.WindowsBuiltInRole.Administrator)) { System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.UseShellExecute = true; p.StartInfo.WorkingDirectory = Environment.CurrentDirectory; p.StartInfo.FileName = Application.ExecutablePath; p.StartInfo.Verb = "runas"; p.Start(); return; } ```
0 回复
作者
liuzy
积分: 841
“ 黑眼圈圈男 ”
无人回复话题
SonarQube 9.4 + PostgreSQL
shell倒计时
日常网络巧技
使用ssh创建socks5代理服务
NodeJS集群demo
作者其他话题
SonarQube 9.4 + PostgreSQL
shell倒计时
日常网络巧技
使用ssh创建socks5代理服务
NodeJS集群demo
回到顶部
友情链接:
JFinal
©2015 Powered by
jfinalbbs
沪ICP备15012258号