http://sshnet.codeplex.com/
adresinden indirdiğim kütüphaneyi kullandım ve çok başarılı bir uygulama.
html kısmında ise komutlarım şöyle
Code:
Code:
umarım size faydası olur.
<asp:DropDownList ID="DropDownList1" runat="server"> <asp:ListItem Value="ls -la">Dizinler</asp:ListItem> <asp:ListItem Value="dir">Dizinler 2</asp:ListItem> <asp:ListItem Value="cd ..">Geri</asp:ListItem> <asp:ListItem Value="service vncserver start">Vnc Start</asp:ListItem> <asp:ListItem Value="service vncserver stop">Vnc Stop</asp:ListItem> <asp:ListItem Value="shutdown -r now">Reset</asp:ListItem> <asp:ListItem Value="free -m">Free Ram</asp:ListItem> <asp:ListItem Value="ps -ux">Çalıştırılan işlemlerin CPU/RAM kullanımıyla gösterir. </asp:ListItem> <asp:ListItem Value="df">Harddisk Kullanımı</asp:ListItem> </asp:DropDownList>
using Renci.SshNet; protected void Button1_Click(object sender, EventArgs e) { using (var client = new SshClient("sunucuIp", "root", "sifre")) { TextBox1.Text = null; client.Connect(); TextBox1.Text = client.RunCommand(DropDownList1.SelectedItem.Value).Result; client.Disconnect(); } }