[英]How to SSh into a raspberry using c Sharp
我需要一個 c # 代碼,它允許我將 ssh 連接到我的樹莓派,然后在其上運行命令。 你有什么想法嗎?
我試過了,但它不起作用
using (var client = new SshClient("hostnameOrIp", "username", "password"))
{
client.Connect();
client.RunCommand("/home/pi/TurnOnLED/TurnOnLED");
client.Disconnect();
}
using (var client = new SshClient("hostnameOrIp", "username", "password"))
{
client.Connect();
client.RunCommand("etc/init.d/networking restart");
client.Disconnect();``
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.