• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

How To Make Remote Desktop With Vb.Net

Status
Not open for further replies.

Gharibe

Leech
User
Joined
Jul 2, 2014
Messages
24
Reputation
0
Reaction score
750
Points
78
Credits
0
‎11 Years of Service‎
48%
How To Make Remote Desktop With Vb.Net

be9aa3e445322.png


Download Video

[HIDE-THANKS]

This link is hidden for visitors. Please Log in or register now.


[/HIDE-THANKS]

Code You Need

[HIDE-THANKS]

Imports System.Net.Sockets
Imports System.Threading
Imports System.Drawing
Imports System.Runtime.Serialization.Formatters.Binary


Public Class Form2
Dim client As New TcpClient
Dim port As Integer
Dim server As TcpListener
Dim ns As NetworkStream
Dim listening As New Thread(AddressOf listen)
Dim getimage As New Thread(AddressOf ReceiveImage)

Private Sub ReceiveImage()
Dim bf As New BinaryFormatter
While client.Connected = True
ns = client.GetStream
PictureBox1.Image = bf.Deserialize(ns)

End While
End Sub


Private Sub listen()
While client.Connected = False
server.Start()
client = server.AcceptTcpClient

End While
getimage.Start()
End Sub


Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
port = Integer.Parse(Form1.TextBox1.Text)
server = New TcpListener(port)
listening.Start()
End Sub

Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click

End Sub
End Class​
Code:
>
Imports System.Net.Sockets
Imports System.Threading
Imports System.Drawing
Imports System.Runtime.Serialization.Formatters.Binary

Public Class Form1
Dim client As New TcpClient
Dim ns As NetworkStream
Dim port As Integer

Public Function Desktop() As Image
Dim bounds As Rectangle = Nothing
Dim screenhost As System.Drawing.Bitmap = Nothing
Dim graph As Graphics = Nothing
bounds = Screen.PrimaryScreen.Bounds
screenhost = New Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
graph = Graphics.FromImage(screenhost)
graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
Return screenhost
End Function

Private Sub sendDesktop()
Dim bf As New BinaryFormatter
ns = client.GetStream
bf.Serialize(ns, Desktop)


End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
port = Integer.Parse(TextBox2.Text)

Try
client.Connect(TextBox1.Text, port)
MsgBox("client connected 1")
Catch ex As Exception
MsgBox("Failed to connect ...")
End Try
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Timer1.Start()
End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
sendDesktop()
End Sub

End Class
Code:
>
[/HIDE-THANKS]




 
Status
Not open for further replies.
Back
Top