Guest User

Untitled

a guest
Jan 18th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. private void UpdateOutputDevice()
  2. {
  3. var UserName = "myusername";
  4. var Password = "mypassword";
  5. try
  6. {
  7. using (var client = new SshClient("127.0.0.1", UserName, Password))
  8. {
  9.  
  10. client.Connect();
  11. var command = "powershell -Command " + "u0022" + "iotcoreaudiocontroltool d " + "u2019" +
  12. "{0.0.0.00000000}.{7a1b2a7e-173d-4889-8918-b813b832cd0c}" + "u2019" + "u0022";
  13.  
  14. var cmd = client.RunCommand(command);
  15. var result = cmd.Result;
  16. SendStatus.Text = result;
  17.  
  18. client.Disconnect();
  19.  
  20. }
  21. }
  22. catch (Exception e )
  23. {
  24. Debug.WriteLine(e);
  25. SendStatus.Text = e.ToString();
  26. }
  27.  
  28.  
  29. }
Add Comment
Please, Sign In to add comment