HASH-RemoteDesktop (Viewer) VB.NET

HASH-RemoteDesktop (Viewer) VB.NET


FORM 1

Imports System.IO
Imports System.Net
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 nstream As NetworkStream
    Public Function Desktop() As Image
        Dim bounds As Rectangle = Nothing
        Dim screenshot As System.Drawing.Bitmap = Nothing
        Dim graph As Graphics = Nothing
        bounds = Screen.PrimaryScreen.Bounds
        screenshot = New Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
        graph = Graphics.FromImage(screenshot)
        graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
        Return screenshot
    End Function

    Private Sub SendImage()
        Try
            Dim bf As New BinaryFormatter
            nstream = client.GetStream
            bf.Serialize(nstream, Desktop())
        Catch ex As Exception

        End Try

    End Sub

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

    Private Sub GunaButton1_Click(sender As Object, e As EventArgs) Handles GunaButton1.Click
        Try
            client.Connect(GunaTextBox1.Text, 8085)
            MsgBox("CONNECTED !")
            Timer1.Start()
        Catch ex As Exception
            MsgBox("Failed to connect...")
        End Try
    End Sub
End Class

Comments

Popular posts from this blog

QR CODE SCANNER (Emgu CV ) VB.NET

Simple Modern Login (Guna UI, Mysql) VB.NET

Simple Lottery Game (Guna UI) VB.NET