RDP相关

基于.net的RDP实现的远程桌面,把源代码拿出来,form1用于采集用户信息,form2用户实现桌面功能:
Public Class Form1
    Dim aa As Integer = 0
    Dim ab As Integer = 0
    Dim ac As Integer = 0


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Form2.Show()
        Me.Hide()

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Button1.Enabled = False
        Timer1.Enabled = True
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If aa = 1 Then
            If ab = 1 Then
                If ac = 1 Then
                    Button1.Enabled = True
                Else
                    Button1.Enabled = False
                End If
            Else
                Button1.Enabled = False
            End If
        Else
            Button1.Enabled = False
        End If
        If Button1.Enabled = True Then
            Timer1.Enabled = False
        End If
    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        aa = 1
    End Sub

    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
        ab = 1
    End Sub

    Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
        ac = 1
    End Sub

   
End Class
 
 
 
 
Public Class Form2

    Private Sub AxMsRdpClient71_OnConnecting(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxMsRdpClient71.OnConnecting
       
    End Sub


    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.AutoSize = True
        AxMsRdpClient71.Server = Form1.TextBox1.Text
        AxMsRdpClient71.UserName = Form1.TextBox2.Text
        AxMsRdpClient71.AdvancedSettings2.RDPPort = 3389
        AxMsRdpClient71.AdvancedSettings2.ClearTextPassword = Form1.TextBox3.Text
        AxMsRdpClient71.AdvancedSettings8.RedirectDevices = True
        AxMsRdpClient71.AdvancedSettings8.RedirectDrives = True
        'AxMsRdpClient71.Width = AutoSize
        'AxMsRdpClient71.Height = AutoSize
        ' AxMsRdpClient71.FullScreen = True
        'AxMsRdpClient71.AdvancedSettings3.SmartSizing = True
        'AxMsRdpClient71.FullScreenTitle = AxMsRdpClient71.Server + "-远程桌面"
        AxMsRdpClient71.Connect()
    End Sub


End Class


 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值