http://www.lansweeper.com/具有允许用户从 Web 应用程序执行远程计算机管理等操作的功能。我需要将它部署在我的 Asp.Net c# web 应用程序中。当我构建我的项目时,我通过代码来完成它,但是当我尝试从 IIS 运行它时它不起作用,什么也没发生。
请提供任何帮助和想法。没有遇到错误
protected void lnkComputermanagement_Click(object sender, EventArgs e)
{
try
{
long InfoID = Convert.ToInt64(txtInfoID.Text);
IBAPanel.NetworkSupport.WMIInfo WMIInfo = new IBAPanel.NetworkSupport.WMIInfo();
WMIInfo = WMIInfo.Get(Convert.ToInt32(InfoID));
string ComName = WMIInfo.ComputerName1;
string Pass = WMIInfo.Password;
if (WMIInfo.UserName != "" && WMIInfo.ComputerName1 != "" && WMIInfo.Password != "")
{
string Usname = WMIInfo.UserName.Substring(2);
ProcessStartInfo startInfo = new ProcessStartInfo();
Process myprocess = new Process();
myprocess.StartInfo.CreateNoWindow = true;
myprocess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
myprocess.StartInfo.UseShellExecute = false;
myprocess.StartInfo.Verb = "runas";
myprocess.StartInfo.FileName = "cmd.exe";
myprocess.StartInfo.UserName = Usname;
myprocess.StartInfo.Password = MakeSecureString(Pass);
myprocess.StartInfo.Arguments = "/C mmc.exe compmgmt.msc /computer:" + ComName;
myprocess.Start();
myprocess.Close();
}
Response.Redirect("content.aspx?lan=fa&gid=524&InfoID=" + InfoID);
ActionJquery();
}
catch (Exception ex)
{
System.Text.StringBuilder cstext1 = new System.Text.StringBuilder();
cstext1.Append(" $(document).ready(function () {");
cstext1.Append("alert(" + ex.Message + ") ");
cstext1.Append(" }); ");
Page.ClientScript.RegisterStartupScript(typeof(Page), "", cstext1.ToString(), true);
}
}