Advertisement
Guest User

Untitled

a guest
Dec 27th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1.  public void SSHFileExisting()
  2.         {
  3.             const String host = "212.237.20.10";
  4.             const String username = "root";
  5.             const String password = "T{1*z1#oye";
  6.             const int port = 22;
  7.  
  8.             using (SftpClient sftp = new SftpClient(host, port, username, password))
  9.             {
  10.                 sftp.Connect();
  11.                 if (sftp.Exists("/home/photos/5.jpg"))
  12.                 {
  13.                     textBox1.Text = "Siedzi tam";
  14.                 }
  15.                 else textBox1.Text = "Ni ma";
  16.  
  17.             }
  18.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement