简体   繁体   English

通过命令提示符远程控制图形化 vb.net 程序

[英]Remotely control a graphical vb.net program through a command prompt

I have created a VB.NET program using windows forms.我使用 windows forms 创建了一个 VB.NET 程序。 The program runs on a remote PC and displays information on a screen.该程序在远程 PC 上运行并在屏幕上显示信息。 The computer does not even have a mouse or keyboard connected to it.计算机甚至没有连接鼠标或键盘。 The program shows the information based on the file that is loaded.该程序根据加载的文件显示信息。

I want to be able to change this file remotely to another file that is already on the remote PC.我希望能够将此文件远程更改为远程 PC 上已经存在的另一个文件。 I can't use a graphical remote desktop client as we have very limited bandwidth.我不能使用图形远程桌面客户端,因为我们的带宽非常有限。

So, my idea is to change the file using the command prompt (I think I'll need something like SSH).所以,我的想法是使用命令提示符更改文件(我想我需要类似 SSH 的东西)。 I'm not sure how to do this.我不知道该怎么做。 Should I use something like this and load DosModule first:我应该使用这样的东西并首先加载 DosModule:

Module DOSModule
   Public Sub Main()
      Console.Write("First, start with Command Prompt processing ...")
      Dim myWinForm As New WinForm
      Application.Run(myWinForm)
   End Sub
End Module

How would I then read commands that is send to the program?然后我将如何读取发送到程序的命令? I also only want one instance of the program running.我也只想运行一个程序实例。

Thanks谢谢

You have 2 options.您有 2 个选项。 The first is a custom program that WILL require some network programming, like it or not.第一个是需要一些网络编程的自定义程序,不管你喜不喜欢。 I would suggest creating either a Command-Line batch file or else a PowerShell script, then creating a program to transfer the script to the remote computer and execute the script.我建议创建一个命令行批处理文件或 PowerShell 脚本,然后创建一个程序将脚本传输到远程计算机并执行脚本。

The second option and the one better suited for you would be to download an SSH server.第二个选项也是更适合您的选项是下载 SSH 服务器。 An SSH server will essentially open a command window and pipe the input and output over to a telnet client running on your machine.一个 SSH 服务器将基本上打开一个命令 window 和 pipe 输入和 Z78E6221F6393D14CE8 上运行您的机器上的客户端。 If you are running a version of Windows Server, an SSH server comes with Windows Server.如果您运行的是 Windows 服务器版本,则 SSH 服务器随附 Windows 服务器。 Otherwise, you can download one for free here: http://www.freesshd.com/否则,您可以在这里免费下载: http://www.freesshd.com/

Once you install the SSH server, you simply use telnet, from a command prompt, to link up with your remote SSH server安装 SSH 服务器后,您只需在命令提示符下使用 telnet 连接远程 SSH 服务器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM