【问题标题】:Start app remotely on computer in c#用c#在计算机上远程启动应用程序
【发布时间】:2016-05-30 14:14:49
【问题描述】:

我想使用 c# 代码从我的 PC 在另一台 PC 上远程启动应用程序。我想要一个 c# 代码,并且在另一台计算机上有应用程序,我想在其上运行应用程序,不想放置 c# 代码。我该怎么办?!

【问题讨论】:

    标签: c# networking network-programming


    【解决方案1】:
    ProcessStartInfo info = new ProcessStartInfo("C:\\PsTools");
    info.FileName = @"C:\PsTools\psexec.exe";
    info.Arguments = @"\\" + serverName + @" -i C:\WINDOWS\notepad.exe";
    info.RedirectStandardOutput = true;
    info.UseShellExecute = false;
    Process p = Process.Start(info);
    

    【讨论】:

    • 服务器名称应该是我的应用程序所在并要运行的计算机的IP地址还是它的PC名称?
    • 它将是目标计算机
    • 使用上述代码前请先安装psexec工具
    • 我用这个:info.Arguments = @"\\" + "Home-pc" + @" -i C:\WINDOWS\notepad.exe",但上面写着couldn't access Home-pc the handle is invalid。我该怎么办?
    猜你喜欢
    • 2013-09-18
    • 2015-06-04
    • 1970-01-01
    • 1970-01-01
    • 2013-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多