以管理员启动外部程序C# 代码,亲测使用分享的哦。
闲话不说,请看下面实例代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Security;
using System.Net;
using System.IO;
namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
SecureString password = new SecureString();
private void Form1_Load(object sender, EventArgs e)
{
string HostName = Dns.GetHostName();
string strPassWord = "管理员密码";
char[] pChar = strPassWord.ToCharArray();
SecureString password = new SecureString();
foreach (char c in pChar)
{