基本信息
源码名称:C# 远程桌面、电子白板、视讯、摄像头、话筒通信源码下载
源码大小:4.35M
文件格式:.rar
开发语言:C#
更新时间:2015-08-24
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
试用说明:
(1)将服务端部署到一台服务器上,然后启动OMCS.Server.exe。
(2)修改客户端配置文件中的服务器的IP,在一台机器上启动客户端,登录一个帐号,比如aa01.
(3)在另一台机器上启动客户端,登录另一个帐号,比如aa02.
(4)aa01可以在主界面的TextBox中中输入aa02,并点击后面的按钮,来连接aa02的视频。
(5)aa02也可以在其UI中输入aa01,并点击后面的按钮,来连接aa01的视频。
(6)测试视讯时,两个客户端最好在不同的房间。
(7)测试白板时,需要连接到同一个用户的白板,才能协同。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using OMCS.Passive;
using ESBasic;
namespace OMCS.Demos.Simplest.Client
{
public partial class DesktopForm : Form
{
private string ownerID;
public DesktopForm(string friendID)
{
InitializeComponent();
this.desktopConnector1.WatchingOnly = false;
this.ownerID = friendID;
this.Text = string.Format("正在访问{0}的桌面", this.ownerID);
this.desktopConnector1.OwnerScreenResolutionChanged = new CbGeneric<Size>(desktopConnector1_OwnerScreenResolutionChanged);
this.desktopConnector1.ConnectEnded = new CbGeneric<ConnectResult>(desktopConnector1_ConnectEnded);
this.desktopConnector1.BeginConnect(this.ownerID);
}
void desktopConnector1_OwnerScreenResolutionChanged(Size obj)
{
this.SetLocation();
this.desktopConnector1.Invalidate();
}
void desktopConnector1_ConnectEnded(ConnectResult result)
{
if (this.InvokeRequired)
{
this.BeginInvoke(new CbGeneric<ConnectResult>(this.desktopConnector1_ConnectEnded), result);
}
else
{
if (result != ConnectResult.Succeed)
{
MessageBox.Show("连接失败!" result.ToString());
}
this.SetLocation();
}
}
//关闭窗口时,主动断开连接,并释放连接器。
private void DesktopForm_FormClosing(object sender, FormClosingEventArgs e)
{
this.desktopConnector1.Disconnect();
this.desktopConnector1.Dispose();
}
private void DesktopForm_Resize(object sender, EventArgs e)
{
this.SetLocation();
}
private void SetLocation()
{
this.desktopConnector1.Size = this.desktopConnector1.DesktopSize;
int x = 0;
int y = 0;
if (this.Width > this.desktopConnector1.Size.Width)
{
x = (this.Width - this.desktopConnector1.Size.Width) / 2;
}
if (this.Height > this.desktopConnector1.Size.Height)
{
y = (this.Height - this.desktopConnector1.Height) / 2;
}
this.desktopConnector1.Location = new Point(x, y);
}
}
}