Guest User

Untitled

a guest
May 5th, 2018
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. Try
  2. rdp.Server = TextBox1.Text
  3. rdp.UserName = TextBox2.Text
  4.  
  5. Dim secured As IMsTscNonScriptable = CType(rdp.GetOcx, IMsTscNonScriptable)
  6.  
  7. secured.ClearTextPassword = TextBox3.Text
  8. rdp.Connect()
  9.  
  10. Catch ex As Exception
  11. MsgBox("ERROR:" & ex.ToString)
  12. End Try
  13.  
  14.  
  15. End Sub
  16.  
  17.  
  18. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  19.  
  20. Try
  21. If rdp.Connected.ToString.Equals("1") Then
  22. rdp.Disconnect()
  23.  
  24. End If
  25. Catch ex As Exception
  26. MsgBox("ERROR: " & ex.ToString)
  27. End Try
  28.  
  29.  
  30. End Sub`
Add Comment
Please, Sign In to add comment