run mmc.exe services.msc " from iis

mafija023

New Member
http://www.lansweeper.com/ has features that let user do some actions such as Remote Computer management and etc from web application. i need to deploy it in my Aspnet c# web application. i do it by the code blow when i build my project it works but when i trying to run it from IIS it doesn't works, just nothing happend.any help and idea please.no error encountered \[code\] 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); }\[/code\]Sincerely yours.
 
Back
Top