Click here to Skip to main content
14,769,190 members
Home » Discussions » Visual Basic
   

Visual Basic

 
AnswerRe: Remote Desktop Application Pin
Dave Kreskowiak17-Apr-12 16:16
mveDave Kreskowiak17-Apr-12 16:16 
GeneralRe: Remote Desktop Application Pin
Newbie5117-Apr-12 16:23
MemberNewbie5117-Apr-12 16:23 
AnswerRe: Remote Desktop Application Pin
Benaiah Mischenko17-Apr-12 18:26
MemberBenaiah Mischenko17-Apr-12 18:26 
GeneralRe: Remote Desktop Application Pin
Newbie5118-Apr-12 7:12
MemberNewbie5118-Apr-12 7:12 
AnswerRe: Remote Desktop Application Pin
Benaiah Mischenko18-Apr-12 9:53
MemberBenaiah Mischenko18-Apr-12 9:53 
GeneralRe: Remote Desktop Application Pin
Newbie5118-Apr-12 10:47
MemberNewbie5118-Apr-12 10:47 
GeneralRe: Remote Desktop Application Pin
Benaiah Mischenko18-Apr-12 10:56
MemberBenaiah Mischenko18-Apr-12 10:56 
GeneralRe: Remote Desktop Application Pin
Newbie5118-Apr-12 11:23
MemberNewbie5118-Apr-12 11:23 
I just tried it out and put the name of the computer for server, WORKGROUP for the domain, since we are on a workgroup, me for username, and me for password. When I ran it, it didn't do anything. any suggestions greatly appreciated. also, how do I "accept" an answer? im kind of new here. Thanks

I was able to get a remote desktop app that you can control the users computer, but the screen is all sideways and messed up, is there a way to fix that? It is using the AXrdpViewer. also, is there a way to make it to where I can disable being able to control the computer? I have tried putting a form over it, but that didn't work

Here is the code for the client:
Imports RDPCOMAPILib
Imports System.Net.Sockets
Public Class Form1
    Dim x As New RDPSession
    Dim clientSocket As New System.Net.Sockets.TcpClient()
    Dim serverStream As NetworkStream
    Dim readData As String
    Dim infiniteCounter As Integer
    Dim a As String
    Dim b As String
    Dim drag As Boolean
    Dim mousex As Integer
    Dim mousey As Integer
    Private Sub Incoming(ByVal Guest As Object)
        Dim MyGuest As IRDPSRAPIAttendee = Guest
        MyGuest.ControlLevel = CTRL_LEVEL.CTRL_LEVEL_INTERACTIVE
    End Sub
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Dim strHostName As String

        strHostName = System.Net.Dns.GetHostName()
        a = System.Net.Dns.GetHostByName(strHostName).AddressList(0).ToString()
        b = 'Username

        readData = "Conected to Chat Server ..."
        clientSocket.Connect("IP ADDRESS", 8888)
        'Label1.Text = "Client Socket Program - Server Connected ..."
        serverStream = clientSocket.GetStream()

        Dim outStream As Byte() = _
        System.Text.Encoding.ASCII.GetBytes(b + "$")
        serverStream.Write(outStream, 0, outStream.Length)
        serverStream.Flush()
        AddHandler x.OnAttendeeConnected, AddressOf Incoming
        x.Open()
        Dim Invitation As IRDPSRAPIInvitation = x.Invitations.CreateInvitation("Trial", "MyGroup", "", 10)
        outStream = System.Text.Encoding.ASCII.GetBytes("V" + "$")
        serverStream.Write(outStream, 0, outStream.Length)
        outStream = System.Text.Encoding.ASCII.GetBytes("V" + Invitation.ConnectionString + "$")
        serverStream.Write(outStream, 0, outStream.Length)
    End Sub
End Class




Here's is the code for the Viewer:

Imports System.Net.Sockets

Public Class Form1
    Dim clientSocket As New System.Net.Sockets.TcpClient()
    Dim serverStream As NetworkStream
    Dim readData As String
    Dim infiniteCounter As Integer
    Dim a As String
    Dim b As String
    Dim drag As Boolean
    Dim mousex As Integer
    Dim mousey As Integer
    Dim Invitation
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Form2.TopMost = True
        TextBox1.Text = Invitation
        If TextBox1.Text.StartsWith("USERNAME says : V") Then
            TextBox1.Text = TextBox1.Text.Remove(0, 12)
        ElseIf TextBox1.Text.StartsWith("USERNAME says : V") Then
            TextBox1.Text = TextBox1.Text.Remove(0, 13)
        End If
        AxRDPViewer1.Connect(TextBox1.Text, "User1", "")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        AxRDPViewer1.Disconnect()
    End Sub

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Form2.Visible = True
        Form2.TopMost = True
        Dim strHostName As String
        strHostName = System.Net.Dns.GetHostName()
        a = System.Net.Dns.GetHostByName(strHostName).AddressList(0).ToString()
       b = 'Username

        readData = "Conected to Chat Server ..."
        msg()
        clientSocket.Connect("IP ADDRESS", 8888)
        'Label1.Text = "Client Socket Program - Server Connected ..."
        serverStream = clientSocket.GetStream()

        Dim outStream As Byte() = _
        System.Text.Encoding.ASCII.GetBytes(b + "$")
        serverStream.Write(outStream, 0, outStream.Length)
        serverStream.Flush()

        Dim ctThread As Threading.Thread = New Threading.Thread(AddressOf getMessage)
        ctThread.Start()
    End Sub

    Private Sub msg()
        If Me.InvokeRequired Then
            Me.Invoke(New MethodInvoker(AddressOf msg))
        Else
            invitation = readData
        End If
    End Sub
    Private Sub getMessage()
        For infiniteCounter = 1 To 2
            infiniteCounter = 1
            serverStream = clientSocket.GetStream()
            Dim buffSize As Integer
            Dim inStream(10024) As Byte
            buffSize = clientSocket.ReceiveBufferSize
            serverStream.Read(inStream, 0, buffSize)
            Dim returndata As String = _
            System.Text.Encoding.ASCII.GetString(inStream)
            readData = "" + returndata
            msg()
        Next
    End Sub
End Class



On the client side, when it is opened, it send a chat message with the "Invitation" to the chat server. The remote viewer takes that message and puts it as the invitation to connect. .

Any help appreciated. IF there is no way to change this, then I will live with it...

modified 20-Apr-12 12:31pm.

QuestionPopulate a pdf or word document from vb.net? Pin
alejx17-Apr-12 14:17
Memberalejx17-Apr-12 14:17 
AnswerRe: Populate a pdf or word document from vb.net? Pin
JohnPayton17-Apr-12 15:33
MemberJohnPayton17-Apr-12 15:33 
GeneralRe: Populate a pdf or word document from vb.net? Pin
alejx17-Apr-12 15:40
Memberalejx17-Apr-12 15:40 
GeneralRe: Populate a pdf or word document from vb.net? Pin
JohnPayton17-Apr-12 15:54
MemberJohnPayton17-Apr-12 15:54 
AnswerRe: Populate a pdf or word document from vb.net? Pin
Richard MacCutchan17-Apr-12 22:29
mveRichard MacCutchan17-Apr-12 22:29 
QuestionWindows Phone 7.5 Mango Screen Size Pin
Midnight Ahri16-Apr-12 16:32
MemberMidnight Ahri16-Apr-12 16:32 
QuestionHow can I have a Tab with closing option ? Pin
Member 883311416-Apr-12 2:22
MemberMember 883311416-Apr-12 2:22 
AnswerRe: How can I have a Tab with closing option ? Pin
VJ Reddy16-Apr-12 5:38
MemberVJ Reddy16-Apr-12 5:38 
AnswerRe: How can I have a Tab with closing option ? Pin
Newbie5118-Apr-12 8:04
MemberNewbie5118-Apr-12 8:04 
Questioncolor to black and white for reduce bytes Pin
bhupinder singh laly12-Apr-12 4:44
Memberbhupinder singh laly12-Apr-12 4:44 
AnswerRe: color to black and white for reduce bytes Pin
Eddy Vluggen12-Apr-12 9:59
professionalEddy Vluggen12-Apr-12 9:59 
QuestionWindows Phone 7.5 Mango Pin
Midnight Ahri11-Apr-12 17:20
MemberMidnight Ahri11-Apr-12 17:20 
AnswerRe: Windows Phone 7.5 Mango Pin
Dave Kreskowiak11-Apr-12 18:50
mveDave Kreskowiak11-Apr-12 18:50 
GeneralRe: Windows Phone 7.5 Mango Pin
Midnight Ahri11-Apr-12 23:06
MemberMidnight Ahri11-Apr-12 23:06 
GeneralRe: Windows Phone 7.5 Mango Pin
Dave Kreskowiak12-Apr-12 4:36
mveDave Kreskowiak12-Apr-12 4:36 
GeneralRe: Windows Phone 7.5 Mango Pin
Midnight Ahri12-Apr-12 17:06
MemberMidnight Ahri12-Apr-12 17:06 
QuestionUsing formula in DataGridView Pin
Amanjot11-Apr-12 9:59
MemberAmanjot11-Apr-12 9:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.