远程过程 [英] remote process

查看:111
本文介绍了远程过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我想通过process.start
在远程系统上运行可执行文件 我使用了此命令,但看到了2个错误
用户名未知或密码错误
指定的路径无法识别.
如何完善此命令以解决此问题
或通过C#远程执行的任何解决方案?

 System.Diagnostics.ProcessStartInfo proc_sg =  System.Diagnostics.ProcessStartInfo();
                proc_sg.FileName = " ;

                proc_sg.CreateNoWindow =  true ;
              proc_sg.UserName = txt_user.Text.ToString();;
              proc_sg.UseShellExecute =  false   true ;
              proc_sg.Verb = " ;
              SecureString pwd =  SecureString();
              字符串 p2 = txt_pass.Text.ToString();
                 foreach ( char 项目 in  p2中的项目)
                {
                    pwd.AppendChar(item);
                }
                pwd.MakeReadOnly(); */
                proc_sg.WorkingDirectory = " ;
                proc_sg.WindowStyle = ProcessWindowStyle.Maximized;
Process.Start(proc_sg); 



解决方案

首先,您无法运行交互式远程进程,因此,如果您尝试启动远程计算机上的用户可以看到的内容,则无法.

考虑一下巨大的安全风险,这是如果您可以让任何Windows计算机运行所需的任何代码而无需用户启动它的话...

您没有将密码分配给您创建的ProcessStartInfo对象(proc_sg).您只分配了一个用户名.

另外,如果远程计算机不在同一域中或不在工作组配置中,则用户名和密码必须存在于远程计算机的帐户数据库中.


感谢您的光临回答
我在帐户数据库中具有正确的特权,并且为此连接设置了权限,并且该文件夹被共享,并且我可以启动此文件夹
但是
我想从网络上的客户端执行此文件
知道有什么解决方案吗?
谢谢


hi i 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

解决方案

First, you cannot run a interactive remote process, so if you were trying to launch something the user on the remote machine could see, you can''t.

Think about that the HUGE security risk this is if you could get any Windows machine to run any code you wanted without the user launching it...

You''re not assigning the password to the ProcessStartInfo object you created (proc_sg). You only assigned a username.

Also, if the remote machine is not in the same domain or is in a workgroup configuration, the username and password must exist in the account database of the remote machine.


hi and thanks for your answer
i have a correct privilieage in the account database and setit for this connection and the folder be shared and i can launched this folder
but
i want to execute this file from my clients of my network
nnow have any solutions?
thanksa


这篇关于远程过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆