C# Class RemoteViewing.Vnc.VncClient

Connects to a remote VNC server and interacts with it.
Datei anzeigen Open project: qmfrederik/remoteviewing Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Closes the connection with the remote server.

Connect ( Stream stream, VncClientConnectOptions options = null ) : void

Connects to a VNC server.

Connect ( string hostname, int port = 5900, VncClientConnectOptions options = null ) : void

Connects to a VNC server with the specified hostname and port.

SendKeyEvent ( int keysym, bool pressed ) : void

Sends a key event to the VNC server to indicate a key has been pressed or released.

SendLocalClipboardChange ( string data ) : void

Notifies the server that the local clipboard has changed. If you are implementing clipboard integration, use this to set the remote clipboard.

SendPointerEvent ( int x, int y, int pressedButtons ) : void

Sends a pointer event to the VNC server to indicate mouse motion, a button click, etc.

VncClient ( ) : System

Initializes a new instance of the VncClient class.

Protected Methods

Method Description
OnBell ( ) : void

Raises the Bell event

OnClosed ( ) : void

Raises the Close event.

OnConnected ( ) : void

Raises the Connected event.

OnConnectionFailed ( ) : void

Raises the ConnectionFailed event.

OnFramebufferChanged ( FramebufferChangedEventArgs e ) : void

Raises the FramebufferChanged event.

OnRemoteClipboardChanged ( RemoteClipboardChangedEventArgs e ) : void

Raises the RemoteClipboardChanged event.

Private Methods

Method Description
AllocateFramebufferScratch ( int bytes ) : byte[]
CopyToFramebuffer ( int tx, int ty, int w, int h, byte pixels ) : void
CopyToGeneral ( int tx, int ty, int tw, int th, byte outPixels, int sx, int sy, int sw, int sh, byte inPixels, int w, int h ) : void
HandleBell ( ) : void
HandleFramebufferUpdate ( ) : void
HandleReceiveClipboardData ( ) : void
HandleSetColorMapEntries ( ) : void
InitFramebufferDecoder ( ) : void
NegotiateDesktop ( ) : void
NegotiateEncodings ( ) : void
NegotiateSecurity ( ) : void
NegotiateVersion ( ) : void
SendFramebufferUpdateRequest ( bool incremental ) : void
ThreadMain ( ) : void

Method Details

Close() public method

Closes the connection with the remote server.
public Close ( ) : void
return void

Connect() public method

Connects to a VNC server.
public Connect ( Stream stream, VncClientConnectOptions options = null ) : void
stream Stream The stream containing the connection.
options VncClientConnectOptions Connection options, if any. You can specify a password here.
return void

Connect() public method

Connects to a VNC server with the specified hostname and port.
public Connect ( string hostname, int port = 5900, VncClientConnectOptions options = null ) : void
hostname string The name of the host to connect to.
port int The port to connect on. 5900 is the usual for VNC.
options VncClientConnectOptions Connection options, if any. You can specify a password here.
return void

OnBell() protected method

Raises the Bell event
protected OnBell ( ) : void
return void

OnClosed() protected method

Raises the Close event.
protected OnClosed ( ) : void
return void

OnConnected() protected method

Raises the Connected event.
protected OnConnected ( ) : void
return void

OnConnectionFailed() protected method

Raises the ConnectionFailed event.
protected OnConnectionFailed ( ) : void
return void

OnFramebufferChanged() protected method

Raises the FramebufferChanged event.
protected OnFramebufferChanged ( FramebufferChangedEventArgs e ) : void
e FramebufferChangedEventArgs /// A that describes the changes /// in the framebuffer. ///
return void

OnRemoteClipboardChanged() protected method

Raises the RemoteClipboardChanged event.
protected OnRemoteClipboardChanged ( RemoteClipboardChangedEventArgs e ) : void
e RemoteClipboardChangedEventArgs /// A that contains information on the /// clipboard changes. ///
return void

SendKeyEvent() public method

Sends a key event to the VNC server to indicate a key has been pressed or released.
public SendKeyEvent ( int keysym, bool pressed ) : void
keysym int The X11 keysym of the key. For many keys this is the ASCII value.
pressed bool true for a key press event, or false for a key release event.
return void

SendLocalClipboardChange() public method

Notifies the server that the local clipboard has changed. If you are implementing clipboard integration, use this to set the remote clipboard.
public SendLocalClipboardChange ( string data ) : void
data string The contents of the local clipboard.
return void

SendPointerEvent() public method

Sends a pointer event to the VNC server to indicate mouse motion, a button click, etc.
public SendPointerEvent ( int x, int y, int pressedButtons ) : void
x int The X coordinate of the mouse.
y int The Y coordinate of the mouse.
pressedButtons int /// A bit mask of pressed mouse buttons, in X11 convention: 1 is left, 2 is middle, and 4 is right. /// Mouse wheel scrolling is treated as a button event: 8 for up and 16 for down. ///
return void

VncClient() public method

Initializes a new instance of the VncClient class.
public VncClient ( ) : System
return System