private void cms_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count == 0) { return; } string temp = ""; try { Entities.SystemSet ss = (Entities.SystemSet)GlobalPars.GloPars["systemset"]; if (!Directory.Exists(ss.EvidenceImgSavePath)) { MessageBox.Show("保存证据的目录[" + ss.EvidenceImgSavePath + "]不存在,请先创建该路径!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } temp = ss.EvidenceImgSavePath + "\\" + DateTime.Now.ToString().Replace(":", "-").Replace("/", "-").Replace(" ", "-") + ".jpg"; Bitmap image = util.WebSnap.StartSnap(this.dataGridView1.SelectedRows[0].Cells["infosource"].Value.ToString()); image.Save(temp); MessageBox.Show("证据保存成功!", "提示"); } catch (Exception ex) { MessageBox.Show("目标网站原因,证据图片生成失败!"); } }
public void GetBitmap() { WebPageBitmap Shot = new WebPageBitmap(this.WebSite /*, this.ScreenWidth, this.ScreenHeight*/); Shot.GetIt(); Bitmap Pic = Shot.DrawBitmap(); Entities.SystemSet ss = (Entities.SystemSet)GlobalPars.GloPars["systemset"]; string temp = ss.EvidenceImgSavePath + "\\" + DateTime.Now.ToString().Replace(":", "-") + ".jpg"; Pic.Save(temp); }