通过互联网远程桌面视图 [英] Remote Desktop view over the internet

查看:263
本文介绍了通过互联网远程桌面视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提出一个远程桌面应用程序。实际上它是一个程序,只能说明你的其他电脑的屏幕.....  目前,我正在一台电脑屏幕上的快照,并将其保存在共享位置,并加载了图像中的其它计算机每20毫秒。 我现在面临所需LAN连接的问题。 我要运行该应用程序在互联网上。我使用C#.NET。 谁能告诉我所有可能的方式做同样的和那些喜欢的方式这是更快,这需要较少的CPU开销,这需要低内存等之间的差异。

I am making a remote desktop application. Actually its a program that can only show you other computer's screen..... Currently I am taking a snapshot of one computer screen and saving it on shared location and loading that image in other computer in every 20 milliseconds. The problem that I am facing now that LAN connection is required. I want to run this application over the internet. I am using C#.net. Can anybody tell me all possible ways to do the same and the difference among those ways like which is faster, which takes less CPU overhead, which takes low memory etc.

推荐答案

使用的 UDP套接字建立到远程计算机的连接。那么COM preSS的图像(JPEG / PNG或任何你想要的),并将其发送到其他计算机。

Use a UDP Socket to establish a connection to the remote machine. Then compress the images(JPEG/PNG or whatever you want) and send them to the other computer.

例如:

服务器:

    serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
    IPEndPoint endPoint = new IPEndPoint(IPAddress.Any, port);
    serverSocket.Bind(endPoint);

    IPEndPoint ipeSender = new IPEndPoint(IPAddress.Any, 0);
    EndPoint epSender = (EndPoint)ipeSender;

    serverSocket.BeginReceiveFrom(byteData, 0, byteData.Length, SocketFlags.None, ref epSender, new AsyncCallback(OnReceive), epSender);

客户端:

client = new UdpClient();
client.Connect(serverIP, serverPort);

ipeSender = new IPEndPoint(IPAddress.Parse(serverIP), serverPort);
epServer = (EndPoint)ipeSender;
client.BeginReceive(new AsyncCallback(OnReceive), epServer);

这篇关于通过互联网远程桌面视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆