• 大小:
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-14
  • 语言: 其他
  • 标签: 计算机  

资源简介

唐朔飞计算机组成原理第二版光盘文件

资源截图

代码片段和文件信息

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.IO;
using System.Net;
using System.Net.Sockets;
using System.CodeDom;
using System.Drawing.Imaging;
using System.Drawing.Design;
 
using System.Threading;
namespace clientDemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        int port = 2000;
        string host = “192.168.1.65“;
        private void button1_Click(object sender EventArgs e)
        {

            Socket c = connect(port host);

            Bitmap bt = new Bitmap(Screen.PrimaryScreen.Bounds.Width Screen.PrimaryScreen.Bounds.Height);
            Graphics g = Graphics.FromImage(bt);
            while (true)//循环发送截图
            {

                MemoryStream ms = new MemoryStream();
                g.CopyFromScreen(new Point(0 0) new Point(0 0) Screen.PrimaryScreen.Bounds.Size);//获取屏幕截图
                Image mm = SaveJpg(bt 10);//设置图片清晰度
                mm = GetWebImage(mm 360 240);//改变截屏图片大小
                mm.Save(ms System.Drawing.Imaging.ImageFormat.Jpeg);

                byte[] buffer = new byte[1024];
                ms.Position = 0;

                int end = 1;
                while (end != 0)
                {
                    end = ms.Read(buffer 0 1024);//end为零表示读取完毕
                    c.Send(buffer buffer.Length 0);//每次发送1024个字节
                }
                string sendStr = “over!“;//结束信息
                byte[] bs = Encoding.ASCII.GetBytes(sendStr);
                c.Send(bs bs.Length 0);//发送测试信息
                ms.Dispose();
            }
            c.Close();
            Console.ReadLine();
        }
        public static Socket connect(int port string host)
        {
            IPAddress ip = IPAddress.Parse(host);
            IPEndPoint ipe = new IPEndPoint(ip port);//把ip和端口转化为IPEndPoint实例 
            Socket c = new Socket(AddressFamily.InterNetwork SocketType.Stream ProtocolType.Tcp);//创建一个Socket    
            Console.WriteLine(“Conneting...“);
            try
            {

                c.Connect(ipe);//连接到服务器 
                return c;
            }
            catch
            {
                Thread.Sleep(1000);
                connect(port host);
                return c;

            }

        }




        public static Image SaveJpg(Image image long value)//设置图像质量1—100
        {
            ImageCodecInfo icInfo = null;
            ImageCodecInfo[] infos = ImageCodecInfo.GetImageEncoders();
            foreach (ImageCodecInfo info in infos)
            {
                if (info.MimeType == “image/jpeg“)
                {
                    icInfo = info;
                    break;
                }
            }

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     19456  2019-04-10 17:47  clientDemo\.vs\clientDemo\v15\.suo

     文件          0  2019-04-10 17:25  clientDemo\.vs\clientDemo\v15\Server\sqlite3\db.lock

     文件       4096  2019-04-10 17:25  clientDemo\.vs\clientDemo\v15\Server\sqlite3\storage.ide

     文件      32768  2019-04-10 17:25  clientDemo\.vs\clientDemo\v15\Server\sqlite3\storage.ide-shm

     文件    1062992  2019-04-10 17:47  clientDemo\.vs\clientDemo\v15\Server\sqlite3\storage.ide-wal

     文件        189  2019-04-10 17:25  clientDemo\clientDemo\App.config

     文件       9728  2019-04-10 17:30  clientDemo\clientDemo\bin\Debug\clientDemo.exe

     文件        189  2019-04-10 17:25  clientDemo\clientDemo\bin\Debug\clientDemo.exe.config

     文件      30208  2019-04-10 17:30  clientDemo\clientDemo\bin\Debug\clientDemo.pdb

     文件       3608  2019-04-10 17:28  clientDemo\clientDemo\clientDemo.csproj

     文件       3934  2019-04-10 17:30  clientDemo\clientDemo\Form1.cs

     文件       2030  2019-04-10 17:28  clientDemo\clientDemo\Form1.Designer.cs

     文件       5817  2019-04-10 17:28  clientDemo\clientDemo\Form1.resx

     文件         42  2019-04-10 17:25  clientDemo\clientDemo\obj\Debug\clientDemo.csproj.CoreCompileInputs.cache

     文件        845  2019-04-10 17:30  clientDemo\clientDemo\obj\Debug\clientDemo.csproj.FileListAbsolute.txt

     文件       1012  2019-04-10 17:28  clientDemo\clientDemo\obj\Debug\clientDemo.csproj.GenerateResource.cache

     文件      11490  2019-04-10 17:25  clientDemo\clientDemo\obj\Debug\clientDemo.csprojAssemblyReference.cache

     文件       9728  2019-04-10 17:30  clientDemo\clientDemo\obj\Debug\clientDemo.exe

     文件        180  2019-04-10 17:28  clientDemo\clientDemo\obj\Debug\clientDemo.Form1.resources

     文件      30208  2019-04-10 17:30  clientDemo\clientDemo\obj\Debug\clientDemo.pdb

     文件        180  2019-04-10 17:28  clientDemo\clientDemo\obj\Debug\clientDemo.Properties.Resources.resources

     文件        831  2019-04-10 17:25  clientDemo\clientDemo\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7180  2019-04-10 17:26  clientDemo\clientDemo\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2019-04-10 17:25  clientDemo\clientDemo\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2019-04-10 17:25  clientDemo\clientDemo\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2019-04-10 17:25  clientDemo\clientDemo\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件        522  2019-04-10 17:25  clientDemo\clientDemo\Program.cs

     文件       1318  2019-04-10 17:25  clientDemo\clientDemo\Properties\AssemblyInfo.cs

     文件       2833  2019-04-10 17:25  clientDemo\clientDemo\Properties\Resources.Designer.cs

     文件       5612  2019-04-10 17:25  clientDemo\clientDemo\Properties\Resources.resx

............此处省略65个文件信息

评论

共有 条评论