Click here to Skip to main content
15,895,817 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Remote Desktop Application Pin
Dave Kreskowiak17-Apr-12 15:16
mveDave Kreskowiak17-Apr-12 15:16 
GeneralRe: Remote Desktop Application Pin
Newbie5117-Apr-12 15:23
Newbie5117-Apr-12 15:23 
AnswerRe: Remote Desktop Application Pin
Benaiah Mischenko17-Apr-12 17:26
Benaiah Mischenko17-Apr-12 17:26 
GeneralRe: Remote Desktop Application Pin
Newbie5118-Apr-12 6:12
Newbie5118-Apr-12 6:12 
AnswerRe: Remote Desktop Application Pin
Benaiah Mischenko18-Apr-12 8:53
Benaiah Mischenko18-Apr-12 8:53 
GeneralRe: Remote Desktop Application Pin
Newbie5118-Apr-12 9:47
Newbie5118-Apr-12 9:47 
GeneralRe: Remote Desktop Application Pin
Benaiah Mischenko18-Apr-12 9:56
Benaiah Mischenko18-Apr-12 9:56 
GeneralRe: Remote Desktop Application Pin
Newbie5118-Apr-12 10:23
Newbie5118-Apr-12 10: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:
VB
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:

VB
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 13:17
alejx17-Apr-12 13:17 
AnswerRe: Populate a pdf or word document from vb.net? Pin
JohnPayton17-Apr-12 14:33
JohnPayton17-Apr-12 14:33 
GeneralRe: Populate a pdf or word document from vb.net? Pin
alejx17-Apr-12 14:40
alejx17-Apr-12 14:40 
GeneralRe: Populate a pdf or word document from vb.net? Pin
JohnPayton17-Apr-12 14:54
JohnPayton17-Apr-12 14:54 
AnswerRe: Populate a pdf or word document from vb.net? Pin
Richard MacCutchan17-Apr-12 21:29
mveRichard MacCutchan17-Apr-12 21:29 
QuestionWindows Phone 7.5 Mango Screen Size Pin
Midnight Ahri16-Apr-12 15:32
Midnight Ahri16-Apr-12 15:32 
QuestionHow can I have a Tab with closing option ? Pin
Member 883311416-Apr-12 1:22
Member 883311416-Apr-12 1:22 
AnswerRe: How can I have a Tab with closing option ? Pin
VJ Reddy16-Apr-12 4:38
VJ Reddy16-Apr-12 4:38 
AnswerRe: How can I have a Tab with closing option ? Pin
Newbie5118-Apr-12 7:04
Newbie5118-Apr-12 7:04 
Questioncolor to black and white for reduce bytes Pin
bhupinder singh laly12-Apr-12 3:44
bhupinder singh laly12-Apr-12 3:44 
AnswerRe: color to black and white for reduce bytes Pin
Eddy Vluggen12-Apr-12 8:59
professionalEddy Vluggen12-Apr-12 8:59 
QuestionWindows Phone 7.5 Mango Pin
Midnight Ahri11-Apr-12 16:20
Midnight Ahri11-Apr-12 16:20 
AnswerRe: Windows Phone 7.5 Mango Pin
Dave Kreskowiak11-Apr-12 17:50
mveDave Kreskowiak11-Apr-12 17:50 
GeneralRe: Windows Phone 7.5 Mango Pin
Midnight Ahri11-Apr-12 22:06
Midnight Ahri11-Apr-12 22:06 
GeneralRe: Windows Phone 7.5 Mango Pin
Dave Kreskowiak12-Apr-12 3:36
mveDave Kreskowiak12-Apr-12 3:36 
GeneralRe: Windows Phone 7.5 Mango Pin
Midnight Ahri12-Apr-12 16:06
Midnight Ahri12-Apr-12 16:06 
QuestionUsing formula in DataGridView Pin
Amanjot11-Apr-12 8:59
Amanjot11-Apr-12 8: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.