Skip to content

Repository files navigation

RemoteViewing Logo

RemoteViewing

🖥️ A .NET-native VNC client and server library 🖥️

It supports Raw, Hextile, Copyrect, and Zlib encodings, and ships ready-to-use controls for Windows Forms, WPF, and cross-platform Avalonia UI, making it extremely easy to embed VNC in your program on Windows, Linux, or macOS.

ActionsGitHub licenseNuGet

✨ Features📦 Installation🚀 Usage🎯 Frameworks📄 License


✨ Features

  • 🔷 Pure .NET Implementation - No native dependencies required
  • 🔄 VNC Client & Server - Full support for both client and server roles
  • 📦 Multiple Encodings - Raw, Hextile, Copyrect, and Zlib compression
  • 🎨 Color Depth Support - 8-bit, 16-bit, and 32-bit color modes
  • 🪟 UI Controls - Ready-to-use controls for Windows Forms, WPF, and Avalonia (cross-platform)
  • 🌐 Cross-Platform UI - Avalonia control runs on Windows, Linux, and macOS with no native VNC dependencies
  • 📋 Clipboard Sharing - Bidirectional clipboard synchronization
  • 📊 Performance Monitoring - Built-in FPS, bandwidth, and CPU statistics
  • 🔍 AutoSize Mode - Automatic scaling with proper coordinate transformation

📦 Installation

Available on NuGet:

PackageNuGet
Lemutec.RemoteViewingNuGet
Lemutec.RemoteViewing.Windows.FormsNuGet
Lemutec.RemoteViewing.WPFNuGet
Lemutec.RemoteViewing.AvaloniaNuGet

Install via NuGet Package Manager:

# Core library
dotnet add package Lemutec.RemoteViewing
# Windows Forms control
dotnet add package Lemutec.RemoteViewing.Windows.Forms
# WPF control
dotnet add package Lemutec.RemoteViewing.WPF
# Avalonia control (Windows / Linux / macOS)
dotnet add package Lemutec.RemoteViewing.Avalonia

🚀 Usage

🪟 VNC Client (Windows Forms)

usingRemoteViewing.Vnc;usingRemoteViewing.Windows.Forms;// Add VncControl to your form, then connect:varoptions=newVncClientConnectOptions();options.Password="your-password".ToCharArray();vncControl.Client.Connect("hostname",5900,options);

🪟 VNC Client (WPF)

usingRemoteViewing.Vnc;usingRemoteViewing.WPF;// Add VncControl to your window, then connect:varoptions=newVncClientConnectOptions();options.Password="your-password".ToCharArray();vncControl.Client.Connect("hostname",5900,options);

🌐 VNC Client (Avalonia, cross-platform)

XAML:

<Windowxmlns="https://github.com/avaloniaui"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:vnc="https://github.com/lemutec/RemoteViewing">
<vnc:VncControlx:Name="VncControl"SizeMode="Zoom"AllowClipboardSharingFromServer="True"AllowClipboardSharingToServer="True" />
</Window>

Code-behind:

usingRemoteViewing.Vnc;usingRemoteViewing.Avalonia;varoptions=newVncClientConnectOptions();options.Password="your-password".ToCharArray();// Connect on a background thread so the UI stays responsive.awaitTask.Run(()=>VncControl.Client.Connect("hostname",5900,options));

Publish for any desktop platform from a single codebase:

# Windows
dotnet publish -f net8.0 -r win-x64 --self-contained false# Linux (x64 / arm64)
dotnet publish -f net8.0 -r linux-x64 --self-contained false
dotnet publish -f net8.0 -r linux-arm64 --self-contained false# macOS (Intel / Apple Silicon)
dotnet publish -f net8.0 -r osx-x64 --self-contained false
dotnet publish -f net8.0 -r osx-arm64 --self-contained false

🖧 VNC Server

usingSystem.Net;usingSystem.Net.Sockets;usingRemoteViewing.Vnc;usingRemoteViewing.Vnc.Server;usingRemoteViewing.Windows.Forms.Server;// Listen for connectionsvarlistener=newTcpListener(IPAddress.Any,5900);listener.Start();varclient=listener.AcceptTcpClient();// Configure server optionsvaroptions=newVncServerSessionOptions();options.AuthenticationMethod=AuthenticationMethod.Password;// Create and start sessionvarsession=newVncServerSession();session.PasswordProvided+=(s,e)=>e.Accept("password".ToCharArray());session.SetFramebufferSource(newVncScreenFramebufferSource("Desktop",Screen.PrimaryScreen));session.Connect(client.GetStream(),options);

🎯 Supported Frameworks

PackageSupported FrameworksSupported OS
Lemutec.RemoteViewing.NET Framework 4.6.2-4.8, .NET Standard 2.0/2.1, .NET 5.0-10.0Windows / Linux / macOS
Lemutec.RemoteViewing.Windows.Forms.NET Framework 4.6.2-4.8, .NET 5.0-10.0Windows
Lemutec.RemoteViewing.WPF.NET Framework 4.6.2-4.8, .NET 5.0-10.0Windows
Lemutec.RemoteViewing.Avalonia.NET Standard 2.0, .NET 6.0-10.0 (Avalonia 11.x)Windows / Linux / macOS

📡 VNC Protocol Support

FeatureClientServer
Raw Encoding
Hextile Encoding
Copyrect Encoding
Zlib Encoding
Password Authentication
Clipboard Sharing
8-bit Color
16-bit Color
32-bit Color

📄 License

This project is licensed under the BSD 2-Clause License. See LICENSE.txt for details.

🙏 Acknowledgments

  • 👨‍💻 Original author: James F. Bellinger
  • 📚 zlib compression support uses a C# port of zlib's deflate code

About

RemoteViewing is a .NET-native VNC client and server library. It supports Raw, Hextile, Copyrect, and Zlib encodings, and includes a Windows Forms and WPF control to make embedding VNC in your program extremely easy.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages