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

资源简介

可以将web浏览器控件中加载的网页截取出来

资源截图

代码片段和文件信息

// 通过 WebBrowser 获取网页截图 示例代码
// http://snowdream.cnblogs.com/

using System;
using System.Drawing;
using System.Windows.Forms;

namespace Snowdream.Sample.WebpageSnapshot
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        /// 
        /// 按钮按下事件处理函数
        /// 

        /// 
        /// 
        private void SaveSnapshot_Click(object sender EventArgs e)
        {
            WebBrowser webBrowser = new WebBrowser();  // 创建一个WebBrowser
            webBrowser.ScrollBarsEnabled = false;  // 隐藏滚动条
            webBrowser.Navigate(address.Text);  // 打开网页
            webBrowser.DocumentCompleted += new WebBrowserDocume

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-05-16 13:35  Snowdream.Sample.WebpageSnapshot\
     目录           0  2011-05-16 13:35  Snowdream.Sample.WebpageSnapshot\bin\
     目录           0  2011-05-16 14:06  Snowdream.Sample.WebpageSnapshot\bin\Debug\
     文件      924394  2011-05-16 14:15  Snowdream.Sample.WebpageSnapshot\bin\Debug\Snapshot.jpg
     文件       10240  2011-05-16 17:04  Snowdream.Sample.WebpageSnapshot\bin\Debug\Snowdream.Sample.WebpageSnapshot.exe
     文件       24064  2011-05-16 17:04  Snowdream.Sample.WebpageSnapshot\bin\Debug\Snowdream.Sample.WebpageSnapshot.pdb
     文件       11600  2011-05-16 17:05  Snowdream.Sample.WebpageSnapshot\bin\Debug\Snowdream.Sample.WebpageSnapshot.vshost.exe
     文件         490  2010-03-17 22:39  Snowdream.Sample.WebpageSnapshot\bin\Debug\Snowdream.Sample.WebpageSnapshot.vshost.exe.manifest
     文件        2463  2011-05-16 17:16  Snowdream.Sample.WebpageSnapshot\Form1.cs
     文件        2604  2011-05-16 17:04  Snowdream.Sample.WebpageSnapshot\Form1.Designer.cs
     文件        5817  2011-05-16 17:04  Snowdream.Sample.WebpageSnapshot\Form1.resx
     目录           0  2011-05-16 13:35  Snowdream.Sample.WebpageSnapshot\obj\
     目录           0  2011-05-16 13:35  Snowdream.Sample.WebpageSnapshot\obj\x86\
     目录           0  2011-05-16 17:04  Snowdream.Sample.WebpageSnapshot\obj\x86\Debug\
     文件        4501  2011-05-16 16:57  Snowdream.Sample.WebpageSnapshot\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6414  2011-05-16 17:04  Snowdream.Sample.WebpageSnapshot\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件         400  2011-05-16 17:04  Snowdream.Sample.WebpageSnapshot\obj\x86\Debug\GenerateResource.read.1.tlog
     文件         998  2011-05-16 17:04  Snowdream.Sample.WebpageSnapshot\obj\x86\Debug\GenerateResource.write.1.tlog
     文件        8031  2011-05-16 17:04  Snowdream.Sample.WebpageSnapshot\obj\x86\Debug\ResolveAssemblyReference.cache
     文件        1189  2011-05-16 17:05  Snowdream.Sample.WebpageSnapshot\obj\x86\Debug\Snowdream.Sample.WebpageSnapshot.csproj.FileListAbsolute.txt
     文件       10240  2011-05-16 17:04  Snowdream.Sample.WebpageSnapshot\obj\x86\Debug\Snowdream.Sample.WebpageSnapshot.exe
     文件         180  2011-05-16 17:04  Snowdream.Sample.WebpageSnapshot\obj\x86\Debug\Snowdream.Sample.WebpageSnapshot.Form1.resources
     文件       24064  2011-05-16 17:04  Snowdream.Sample.WebpageSnapshot\obj\x86\Debug\Snowdream.Sample.WebpageSnapshot.pdb
     文件         180  2011-05-16 14:04  Snowdream.Sample.WebpageSnapshot\obj\x86\Debug\Snowdream.Sample.WebpageSnapshot.Properties.Resources.resources
     目录           0  2011-05-16 13:35  Snowdream.Sample.WebpageSnapshot\obj\x86\Debug\TempPE\
     文件         524  2011-05-16 13:35  Snowdream.Sample.WebpageSnapshot\Program.cs
     目录           0  2011-05-16 13:35  Snowdream.Sample.WebpageSnapshot\Properties\
     文件        1494  2011-05-16 13:35  Snowdream.Sample.WebpageSnapshot\Properties\AssemblyInfo.cs
     文件        2892  2011-05-16 13:35  Snowdream.Sample.WebpageSnapshot\Properties\Resources.Designer.cs
     文件        5612  2011-05-16 13:35  Snowdream.Sample.WebpageSnapshot\Properties\Resources.resx
     文件        1117  2011-05-16 13:35  Snowdream.Sample.WebpageSnapshot\Properties\Settings.Designer.cs
............此处省略3个文件信息

评论

共有 条评论