我想知道是否有办法从非管理员应用程序中以管理员用户身份运行进程,我尝试使用此方法:
$user_rep = $_SESSION['login'] == 1 ? $_SESSION['user_rep'] : 0;
$html = '<div class="privileges-cases">';
$html .= '<span class="' . <?= $user_rep >= 1 ? "half-opacity" : ""; ?> . '"></spam><i class="fa fa-check"></i>At least 1 reputation for asking/answring question</span>';
$html .= '<span class="' . <?= $user_rep >= 15 ? "half-opacity" : ""; ?> . '"></spam><i class="fa fa-check"></i>At least 15 reputation for upvote</span>';
$html .= '<span class="' . <?= $user_rep >= 50 ? "half-opacity" : ""; ?> . '"></spam><i class="fa fa-check"></i>At least 50 reputation for commenting</span>';
$html .= '<span class="' . <?= $user_rep >= 125 ? "half-opacity" : ""; ?> . '"></spam><i class="fa fa-check"></i>At least 125 reputation for downvote</span>';
$html .= '</div>';
我收到此错误:
System.InvalidOperationException:'Process对象必须将UseShellExecute属性设置为false才能以用户'
启动进程我无法将ShellExecute设置为true并使用用户名和密码,但我需要将其设置为true以将Verb设置为“runas”。
答案 0 :(得分:-3)
我有解决方案:var password = "true";
最好的问候汤米,如果你需要工作,请打电话给我;)