c# 保存屏幕到图片中
public void getScreen()
{
Image myImage = new Bitmap(1024, 768);
Graphics g = Graphics.FromImage(myImage);
g.CopyFromScreen(new Point(0, 0), new Point(0, 0), new Size(1024, 768));
IntPtr dc1 = g.GetHdc();
g.ReleaseHdc(dc1);
String path = Server.MapPath("~/");
Random objRand = new Random();
String pic_name = DateTime.Now.ToString("yyyyMMddHHmmssffff") + ".jpg";
string allpathname = path + pic_name;
myImage.Save(allpathname);
}