当前位置: 首页 > news >正文

重庆建站费用自己的电脑做网站云存储

重庆建站费用,自己的电脑做网站云存储,不写编程可以做网站建设,做301网站打不开【背景】 封闭环境无法拷贝外来的远程桌面软件#xff0c;所以就直接自己用C#写一个。 【效果】 【说明】 本篇会给出完整的编程步骤#xff0c;照着写就能拥有你自己的远程桌面应用#xff0c;直接可以运行在局域网。 如果不想自己敲代码#xff0c;也可以选择直接下载…【背景】 封闭环境无法拷贝外来的远程桌面软件所以就直接自己用C#写一个。 【效果】 【说明】 本篇会给出完整的编程步骤照着写就能拥有你自己的远程桌面应用直接可以运行在局域网。 如果不想自己敲代码也可以选择直接下载项目资源解包后直接用VS2019打开即可运行或自行打包成exe https://download.csdn.net/download/weixin_41697242/88350078 【设计】 远程桌面需要一个服务端一个客户端各自是一个项目文件。 本项目中客户端分享画面发送截屏数据流服务端则是监听并接收画面因此服务端需要两个Form窗体。 【项目源码】 客户端UI 只需要一个Form1布局如下 具体组件和属性设置如下 Label1text改为IP即可 Label2text改为Port即可 textbox1名称改为txtIP textbox2名称改为txtPorttext改为80 button1text改为Connect名称改为btnConnect button2text改为ShareScreen名称改为btnShare 客户端源码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;using System.Net.Sockets; using System.Drawing.Imaging; using System.Runtime.Serialization.Formatters.Binary;namespace OriginalClient {public partial class Form1 : Form{private readonly TcpClient client new TcpClient();private NetworkStream mainStream;private int portNumber;private static Image GrabDesktop(){Rectangle bound Screen.PrimaryScreen.Bounds;Bitmap screenshot new Bitmap(bound.Width, bound.Height, PixelFormat.Format32bppArgb);Graphics graphics Graphics.FromImage(screenshot);graphics.CopyFromScreen(bound.X, bound.Y, 0, 0, bound.Size, CopyPixelOperation.SourceCopy);return screenshot;}private void SendDesktopImage(){BinaryFormatter binFormatter new BinaryFormatter();mainStream client.GetStream();binFormatter.Serialize(mainStream, GrabDesktop());}public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){btnShare.Enabled false;}private void btnConnect_Click(object sender, EventArgs e){portNumber int.Parse(txtPort.Text);try{client.Connect(txtIP.Text, portNumber);btnConnect.Text Connected;MessageBox.Show(Connected);btnConnect.Enabled false;btnShare.Enabled true;}catch (Exception){MessageBox.Show(Failed to connect);btnConnect.Text Not Connected;}}private void btnShare_Click(object sender, EventArgs e){if (btnShare.Text.StartsWith(Share)){timer1.Start();btnShare.Text Stop Sharing;}else {timer1.Stop();btnShare.Text Share My Screen;}}private void timer1_Tick(object sender, EventArgs e){SendDesktopImage();}} }服务端UI Form1 textBox1name设置为txtPort button1name设置为btnListen Form1代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;namespace OriginalServer {public partial class Form1 : Form{public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){}private void btnListen_Click(object sender, EventArgs e){new Form2(int.Parse(txtPort.Text)).Show();btnListen.Enabled false;}} }Form2 源项目中追加一个窗体。 一个窗体里放一个imageBoxmode设置为zoomdock设置为停靠。 Form2源码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;using System.Net.Sockets; using System.Net; using System.Threading; using System.Runtime.Serialization.Formatters.Binary;namespace OriginalServer {public partial class Form2 : Form{private readonly int port;private TcpClient client;private TcpListener server;private NetworkStream mainStream;private readonly Thread Listening;private readonly Thread GetImage;public Form2(int Port){port Port;client new TcpClient();Listening new Thread(StartListening);GetImage new Thread(Receiveimage);InitializeComponent();}private void StartListening(){while (!client.Connected) {server.Start();client server.AcceptTcpClient();}GetImage.Start();}private void StopListening() {server.Stop();client null;if (Listening.IsAlive) Listening.Abort();if (GetImage.IsAlive) Listening.Abort();}private void Receiveimage(){BinaryFormatter binFormatter new BinaryFormatter();while (client.Connected) {mainStream client.GetStream();pictureBox1.Image (Image)binFormatter.Deserialize(mainStream);}}protected override void OnLoad(EventArgs e){base.OnLoad(e);server new TcpListener(IPAddress.Any, port);Listening.Start();}protected override void OnFormClosing(FormClosingEventArgs e){base.OnFormClosing(e);StopListening();}private void pictureBox1_Click(object sender, EventArgs e){}private void Form2_Load(object sender, EventArgs e){}} }
http://www.pierceye.com/news/757689/

相关文章:

  • 长春行业网站重庆智能建站模板
  • 北湖区网站建设公司wordpress的cute主题
  • 沈阳网站建设 景乔科技网站制作杭州
  • 网站维护工程师月薪多少精品网站建设公
  • 永久免费企业网站申请网站开发主框架一般用什么布局
  • 网站做非经营性广告需备案python免费看电影的应用
  • 网站分哪些种类自己做网站模版
  • 汪峰做的音乐网站长沙制作公园仿竹护栏实体厂家
  • 深圳专业网站建设公司排名好的h5网站模板
  • h5做网站教程网店营销的推广方法有哪些
  • 网站关键词快速排名工具wordpress子主题
  • 做百度网站那家好google 网站质量问题
  • 网站建设维护书网站资料清单
  • 网站建设公司 深圳信科网站维护计划
  • 做网站用什么语言比较简单网站seo优化总结
  • 四川省工程建设信息网站南京好的网站设计公司
  • 城市建设单招网站合肥哪个公司做网站好
  • 深圳建站模板建站建筑公司对企业未来希望
  • 商丘网站制作电话文库网站建设
  • 新闻发布网站模板医院网站建设原理
  • 网站开发立项报告网页制作视频教程优质课
  • 网站运营分析竞争对手整站采集wordpress
  • 创建一个网站所需的成本厦门礼品网站商城制作案例
  • 南昌建设企业网站公司游戏源码
  • 网站当电话线做php网站教程视频教程
  • 百度里面的站长工具怎么取消怎么注册公司官网
  • 网站开发遵循软件管理工程师
  • 网站开发问题论文武进网站建设机构
  • 网站建设有哪些种类网站开发工程师岗位
  • 电大形考任在哪个网站做旺道seo优化软件怎么用