当我在玩 Visual Studio(尝试通过 ssh 运行命令)时,出现了问题,程序无法正常工作。我在网上搜索了几个小时,但没有找到任何解决我问题的方法。
这是代码:
using Renci.SshNet;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
using (var sshClient = new SshClient("ip censor", "root", "password censor"))
{
sshClient.Connect();
sshClient.RunCommand("screen -S BungeeCord -X stuff 'alert ciao'`echo -ne '\015'`");
sshClient.Disconnect();
}
}
}
}
这就是错误
'WindowsFormsApplication3.vshost.exe' (CLR v4.0.30319: WindowsFormsApplication3.vshost.exe): Loaded ' c:\users\firestorm\documents\visual studio 2015\Projects\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.exe'. Symbols loaded.
'WindowsFormsApplication3.vshost.exe' (CLR v4.0.30319: WindowsFormsApplication3.vshost.exe): Loaded 'c:\users\firestorm\documents\visual studio 2015\Projects\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\Renci. SshNet.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication3.vshost.exe' (CLR v4.0.30319: WindowsFormsApplication3.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication3.vshost.exe' (CLR v4.0.30319: WindowsFormsApplication3.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_it_b77a5c561934e089\mscorlib.resources.dll'. Module was built without symbols.
'WindowsFormsApplication3.vshost.exe' (CLR v4.0.30319: WindowsFormsApplication3.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Dynamic\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Dynamic.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication3.vshost.exe' (CLR v4.0.30319: WindowsFormsApplication3.vshost.exe): Loaded 'Anonymously Hosted DynamicMethods Assembly'.
thread 0x38e4 has exited with code 0 (0x0).
The thread 0x1e7c has exited with code 0 (0x0).
The thread 0x1a00 has exited with code 0 (0x0).
The thread 0x2a90 has exited with code 0 (0x0).
The thread 0x3e4c has exited with code 0 (0x0).
The thread 0x3128 has exited with code 0 (0x0).
The thread 0x3c48 has exited with code 0 (0x0).
The thread 0x12e0 has exited with code 0 (0x0).
The thread 0x136c has exited with code 0 (0x0).
The program '[15892] WindowsFormsApplication3.vshost.exe' has exited with code 0 (0x0).
我究竟做错了什么?谢谢您的帮助!