• 大小: 0.04M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签:

资源简介

C#抓取当前Windows桌面截图

资源截图

代码片段和文件信息

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.Runtime.InteropServices;

namespace drawpartImage
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        [DllImport(“user32.dll“ EntryPoint = “GetSystemMetrics“)]
        private static extern int GetSystemMetrics(int mVal);
        private void button1_Click(object sender EventArgs e)
        {
            Bitmap _Source = new Bitmap(GetSystemMetrics(0) GetSystemMetrics(1));
            using (Graphics g = Graphics.FromImage(_Source))
            {
                g.CopyFromScreen(0 0 0 0

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-01-17 12:02  抓取桌面\
     目录           0  2013-01-17 12:02  抓取桌面\drawpartImage\
     文件         929  2009-02-07 08:48  抓取桌面\drawpartImage.sln
     文件       14848  2009-02-07 08:54  抓取桌面\drawpartImage.suo
     目录           0  2013-01-17 12:02  抓取桌面\drawpartImage\bin\
     目录           0  2013-01-17 12:02  抓取桌面\drawpartImage\bin\Debug\
     文件        8704  2009-02-07 08:54  抓取桌面\drawpartImage\bin\Debug\drawpartImage.exe
     文件       24064  2009-02-07 08:54  抓取桌面\drawpartImage\bin\Debug\drawpartImage.pdb
     文件       14328  2010-08-18 17:50  抓取桌面\drawpartImage\bin\Debug\drawpartImage.vshost.exe
     文件         490  2010-08-18 17:50  抓取桌面\drawpartImage\bin\Debug\drawpartImage.vshost.exe.manifest
     文件        3772  2009-02-07 08:52  抓取桌面\drawpartImage\drawpartImage.csproj
     文件         928  2009-02-07 08:54  抓取桌面\drawpartImage\Form1.cs
     文件        2830  2009-02-07 08:52  抓取桌面\drawpartImage\Form1.Designer.cs
     文件        5814  2009-02-07 08:52  抓取桌面\drawpartImage\Form1.resx
     目录           0  2013-01-17 12:02  抓取桌面\drawpartImage\obj\
     目录           0  2013-01-17 12:02  抓取桌面\drawpartImage\obj\Debug\
     文件         686  2009-02-07 08:54  抓取桌面\drawpartImage\obj\Debug\drawpartImage.csproj.FileListAbsolute.txt
     文件         847  2009-02-07 08:52  抓取桌面\drawpartImage\obj\Debug\drawpartImage.csproj.GenerateResource.Cache
     文件        8704  2009-02-07 08:54  抓取桌面\drawpartImage\obj\Debug\drawpartImage.exe
     文件         180  2009-02-07 08:52  抓取桌面\drawpartImage\obj\Debug\drawpartImage.Form1.resources
     文件       24064  2010-08-18 17:50  抓取桌面\drawpartImage\obj\Debug\drawpartImage.pdb
     文件         180  2009-02-07 08:52  抓取桌面\drawpartImage\obj\Debug\drawpartImage.Properties.Resources.resources
     目录           0  2012-05-02 09:51  抓取桌面\drawpartImage\obj\Debug\TempPE\
     文件         494  2009-02-07 08:48  抓取桌面\drawpartImage\Program.cs
     目录           0  2013-01-17 12:02  抓取桌面\drawpartImage\Properties\
     文件        1358  2009-02-07 08:48  抓取桌面\drawpartImage\Properties\AssemblyInfo.cs
     文件        2876  2009-02-07 08:48  抓取桌面\drawpartImage\Properties\Resources.Designer.cs
     文件        5612  2009-02-07 08:48  抓取桌面\drawpartImage\Properties\Resources.resx
     文件        1098  2009-02-07 08:48  抓取桌面\drawpartImage\Properties\Settings.Designer.cs
     文件         249  2009-02-07 08:48  抓取桌面\drawpartImage\Properties\Settings.settings

评论

共有 条评论