之前看到论坛上有人问这个问题,我觉得winform其实已经把方法封装好了,其实满简单的,其他的不说了,直接看下面代码把。 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; namespace FormCopy { public partial class Form1 : Form { public Form1() { InitializeComponent(); } //截屏幕方法 private void FormCpy() { string sFileName = ""; string sPath = @"E:/Test/Image/"; Random rnd = new Random(); int width = 0; int heigh = 0; width = this.Size.Width; heigh = this.Size.Height; Bitmap bmp = new Bitmap(width, heigh); System.Reflection.Assembly ass = System.Reflection.Assembly.GetExecutingAssembly(); sFileName =sPath + DateTime.Now.ToString("yyyyMMddHHmmss_") + ass.GetName().Name + "_" + this.Name + "_" + rnd.Next(999) + ".jpg"; this.DrawToBitmap(bmp, new Rectangle(0, 0, width, heigh)); bmp.Save(sFileName,System.Drawing.Imaging.ImageFormat.Jpeg); } private void button1_Click(object sender, EventArgs e) { FormCpy(); } } }