本文介绍了远程过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨我想通过process.start在远程系统上运行可执行文件我使用了此命令,但看到了2个错误
用户名未知或密码错误
指定的路径无法识别.
如何完善此命令以解决此问题
或通过C#远程执行的任何解决方案?
System.Diagnostics.ProcessStartInfo proc_sg = 新 System.Diagnostics.ProcessStartInfo(); proc_sg.FileName = " filename.exe" ; proc_sg.CreateNoWindow = true ; proc_sg.UserName = txt_user.Text.ToString();; proc_sg.UseShellExecute = false true ; proc_sg.Verb = " runas" ; SecureString pwd = 新 SecureString(); 字符串 p2 = txt_pass.Text.ToString(); foreach ( char 项目 in p2中的项目) { pwd.AppendChar(item); } pwd.MakeReadOnly(); */ proc_sg.WorkingDirectory = " \\\\ ip_remote pc \\ folder" ; proc_sg.WindowStyle = ProcessWindowStyle.Maximized; Process.Start(proc_sg);
解决方案
hii want to run a executable file on remote system via process.start
i used this commands but i saw 2erors
unknown username or bad password
the specify path is not recognized.
how to perfect this commands to solve this problems
or any solution for execute remotely via C#?
System.Diagnostics.ProcessStartInfo proc_sg = new System.Diagnostics.ProcessStartInfo(); proc_sg.FileName ="filename.exe"; proc_sg.CreateNoWindow= true ; proc_sg.UserName = txt_user.Text.ToString();; proc_sg.UseShellExecute =false true; proc_sg.Verb = "runas"; SecureString pwd = new SecureString(); string p2 = txt_pass.Text.ToString(); foreach (char item in p2 ) { pwd.AppendChar(item); } pwd.MakeReadOnly();*/ proc_sg.WorkingDirectory = "\\\\ip_remote pc\\folder"; proc_sg.WindowStyle = ProcessWindowStyle.Maximized; Process.Start(proc_sg);
Thanks
解决方案
这篇关于远程过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!