• 大小: 95KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-07
  • 语言: C#
  • 标签: C#  

资源简介

基于UDP组播协议的屏幕监控源码 图片局部刷新原理 有很多可以修改的地方 比如图片切片的方式可以修改。一直想改没有时间去改。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.IO;
namespace ClientPre
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
       private  UdpClient client;

       
       string a = ““;
        private void Form1_Load(object sender EventArgs e)
        {
            IPEndPoint ip = new IPEndPoint(IPAddress.Any 22222);
            client = new UdpClient(ip);

            sends();
           timer1.Enabled = true;
        }
        private void sends() {
            IPEndPoint ip = new IPEndPoint(IPAddress.Parse(“225.1.1.1“) 55555);
            List list = new List();
            int xi = 250;
            int yi = 150;
            int xi1 = 0;
            int yi1 = 0;
            for(int i=1;i<6;i++){
            for(int j=1;j<7;j++){
            if(i!=5){
            xi1=xi;
            yi1=yi;
            //(((i-1)*xi(j-1)*yi)((i-1)*xi(j-1)*yi)xi1*yi1)
            }else{
            xi1=336;
            if(j==6){
              yi1=18;
               //(((i-1)*xi(j-1)*yi)((i-1)*xi(j-1)*yi)xi1*yi1)
            }
        }
            Bitmap btmp = new Bitmap(xi1 yi1);
                    using (Graphics gs = Graphics.FromImage(btmp))
                    {
                        using (MemoryStream ms = new MemoryStream())
                        {
                            gs.CopyFromScreen(new Point((i - 1) * xi (j - 1) * yi)new Point(0 0) new System.Drawing.Size(xi1yi1));

                            btmp.Save(ms System.Drawing.Imaging.ImageFormat.Jpeg);
                            byte[] bystr = ASCIIEncoding.Default.GetBytes(i+““+j);
                            byte[] by = ms.ToArray();
                            list.AddRange(bystr);
                            list.AddRange(by);
                            client.Send(list.ToArray() list.ToArray().Length ip);
                            a = (ms.ToArray().Length).ToString();
                            list.Clear();
                        }

                }

                }

                this.Text = a;
                //new Point(0 0) new Point(0 0) new Point(System.Windows.Forms.SystemInformation.VirtualScreen.Width System.Windows.Forms.SystemInformation.VirtualScreen.Height)
                //gs.CopyFromScreen(new Point(0 0) new Point(0 0) new System.Drawing.Size(500 500));
                //using (MemoryStream ms = new MemoryStream())
                //{
                //    btmp.Save(ms System.Drawing.Imaging.ImageFormat.Jpeg);
                //    pictureBox1.Image = Image.FromStream(ms);
                //    IPEndPoint ip = new IPEnd

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-12-10 15:54  ClientPre\
     目录           0  2014-12-10 14:09  ClientPre\ClientPre\
     文件        1309  2014-12-10 16:31  ClientPre\ClientPre.sln
     文件       35840  2015-03-26 20:30  ClientPre\ClientPre.suo
     目录           0  2014-12-10 14:08  ClientPre\ClientPre\bin\
     目录           0  2014-12-10 14:56  ClientPre\ClientPre\bin\Debug\
     文件       10240  2015-03-25 08:40  ClientPre\ClientPre\bin\Debug\ClientPre.exe
     文件       26112  2015-03-25 08:40  ClientPre\ClientPre\bin\Debug\ClientPre.pdb
     文件       11600  2015-03-26 20:24  ClientPre\ClientPre\bin\Debug\ClientPre.vshost.exe
     文件         490  2012-06-02 22:34  ClientPre\ClientPre\bin\Debug\ClientPre.vshost.exe.manifest
     文件        3677  2014-12-10 14:56  ClientPre\ClientPre\ClientPre.csproj
     文件        3474  2015-03-26 20:30  ClientPre\ClientPre\Form1.cs
     文件        3337  2015-03-26 20:30  ClientPre\ClientPre\Form1.Designer.cs
     文件        6011  2015-03-26 20:30  ClientPre\ClientPre\Form1.resx
     目录           0  2014-12-10 14:08  ClientPre\ClientPre\obj\
     目录           0  2014-12-10 14:08  ClientPre\ClientPre\obj\x86\
     目录           0  2015-03-25 08:40  ClientPre\ClientPre\obj\x86\Debug\
     文件         890  2015-03-26 20:24  ClientPre\ClientPre\obj\x86\Debug\ClientPre.csproj.FileListAbsolute.txt
     文件         975  2015-03-25 08:40  ClientPre\ClientPre\obj\x86\Debug\ClientPre.csproj.GenerateResource.Cache
     文件        9174  2014-12-10 15:38  ClientPre\ClientPre\obj\x86\Debug\ClientPre.csprojResolveAssemblyReference.cache
     文件       10240  2015-03-25 08:40  ClientPre\ClientPre\obj\x86\Debug\ClientPre.exe
     文件         180  2015-03-25 08:40  ClientPre\ClientPre\obj\x86\Debug\ClientPre.Form1.resources
     文件       26112  2015-03-25 08:40  ClientPre\ClientPre\obj\x86\Debug\ClientPre.pdb
     文件         180  2014-12-10 14:56  ClientPre\ClientPre\obj\x86\Debug\ClientPre.Properties.Resources.resources
     文件        5420  2014-12-10 15:37  ClientPre\ClientPre\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6401  2015-03-25 08:40  ClientPre\ClientPre\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2014-12-10 14:08  ClientPre\ClientPre\obj\x86\Debug\TempPE\
     文件         490  2014-12-10 14:08  ClientPre\ClientPre\Program.cs
     目录           0  2014-12-10 14:08  ClientPre\ClientPre\Properties\
     文件        1350  2014-12-10 14:08  ClientPre\ClientPre\Properties\AssemblyInfo.cs
     文件        2870  2014-12-10 14:08  ClientPre\ClientPre\Properties\Resources.Designer.cs
............此处省略35个文件信息

评论

共有 条评论