Click here to Skip to main content
15,886,518 members
Articles / Programming Languages / Visual Basic

RDP Manager

Rate me:
Please Sign up or sign in to vote.
4.38/5 (3 votes)
11 Oct 2006CPOL3 min read 71K   2K   33  
Simple RDP and VNC connection manager built on .NET 2.0.
Public Class frmSettings
	Dim con As Connection = Form1.selcon

	Private Sub frmSettings_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
		txtName.Text = con.Name
		txtAddress.Text = con.FullAddress
		cbPrefCon.SelectedIndex = con.PrefCon
		If con.PromptForCredentials = 0 Then
			chkCred.Checked = True
		Else
			chkCred.Checked = False
		End If
		lblTC.Text = con.TimesConnected
		If con.LastConnect = #1/1/1900# Or con.LastConnect = #12:00:00 AM# Then
			lblLC.Text = Nothing
		Else
			lblLC.Text = con.LastConnect
		End If
	End Sub

	Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
		Me.Close()
	End Sub

	Private Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
		Form1.TreeView1.Nodes.Remove(con)
		con.Name = txtName.Text
		con.Text = con.Name
		con.FullAddress = txtAddress.Text
		con.PrefCon = cbPrefCon.SelectedIndex
		con.PromptForCredentials = Not chkCred.Checked
		con.SaveToReg()
		Form1.TreeView1.Nodes.Add(con)
		Form1.TreeView1.Sort()
		Form1.TreeView1.Update()
		Me.Close()
	End Sub
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions