(1)安装httpwatch;
(2)打开c#工程,在“引用”中增加“COM”组件,在“COM”组件中找到“HttpWatch Professional 7.2 Automation Libary”,确定。(7.2为我安装的httpwatch版本)
(3)copy代码
using System;
using HttpWatch;
namespace page_check
{
class PageChecker
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("Enter the URL of the page to check (press enter for http://www.baidu.com/):\r\n");
string url = Console.ReadLine();
if ( url.Length == 0 )
url = "http://www.baidu.com/";
Console.WriteLine("\r\nChecking " + url + "...\r\n");
// Create a new instance of HttpWatch in IE
Controller control = new Controller();
Plugin plugin = control.IE.New();
// Start Recording HTTP traffic
plugin.Log.EnableFilter(false);
plugin.Record();
// Goto to the URL and wait for the page to be loaded
plugin.GotoURL(url);
control.Wait(plugin, -1);
// Stop recording HTTP
plugin.Stop();
if (plugin.Log.Pages.Count != 0)
{
Console.WriteLine("\r\nPage Title: '" + plugin.Log.Pages[0].Title + "'");
Console.WriteLine();
// Display summary statistics for page
Summary summary = plugin.Log.Pages[0].Entries.Summary;
Console.WriteLine("Total time to load page (secs): " + summary.Time);
Console.WriteLine("Number of bytes received on network: " + summary.BytesReceived);
Console.WriteLine("HTTP compression saving (bytes): " + summary.CompressionSavedBytes);
Console.WriteLine("Number of round trips: " + summary.RoundTrips);
Console.WriteLine("Number of errors: " + summary.Errors.Count);
Console.WriteLine("-----------------------",plugin.Log.Entries.Count);
//Entries e = plugin.Log.Entries;
for (int i=0; i<plugin.Log.Entries.Count; i++)
{
Console.Write(plugin.Log.Entries[i].URL);
Console.WriteLine(" " + plugin.Log.Entries[i].Time);
}
}
// Close down IE
plugin.CloseBrowser();
Console.WriteLine( "\r\nPress Enter to exit");
Console.ReadLine();
}
}
}
(4)运行
完成!
分享到:
相关推荐
C# 之httpwatch 缩减HttpWatch成可以进行二次开发的代码
调用httpwatch API HttpWatch是强大的网页数据分析工具.集成在Internet Explorer工具栏.包括网页摘要.Cookies管理.缓存管理.消息头发送/接受.字符查询.POST 数据和目录管理功能.报告输出.HttpWatch 是一款能够收集并...
HttpWatch,使用方法HttpWatch,使用方法HttpWatch,使用方法
httpwatch使用文档
httpwatch 功能及使用技巧和说明 内容详细.
使用c#语言自动化执行httpWatch,然后将执行结果保存到csv文件中。
主要介绍了HttpWatch Professional 其使用方法和日志内容分析
HttpWatch Basic使用StepBy Setp图解版
能记录访问网址所调用的链接,很适合做url网站限制之前的分析工作 绿色无广告,有操作文档。
HttpWatch是强大的网页数据分析工具.集成在Internet Explorer工具栏.包括网页摘要.Cookies管理.缓存管理.消息头发送/接受.字符查询.POST 数据和目录管理功能.报告输出.HttpWatch 是一款能够收集并显示深层信息的软件...
HttpWatch工具简介及使用技巧 HttpWatch工具简介及使用技巧 详细介绍
HTTPwatch如何使用
使用与ie7,ie8,ie9和firefox的Http协议抓取包小工具。
httpWatch使用教程1.pdf
httpWatch使用教程.pdf
httpwatch pro使用技巧 httpwatch pro使用技巧 httpwatch pro使用技巧 图文并茂
自己写的一个httpWatch自动化测试...用户只要安装HttpWatch,并且运行本工具,即可调用httpwatch,自动测试网站,并将测试结果(测试结果_**.hwl)保存下来,开发人员拿到测试结果就可以很方便地查找、分析、定位问题。
HttpWatch安装及使用说明(支持IE,firefox)。
httpwatch相关使用说明,pdf格式,希望大家喜欢。httpwatch相关使用说明,pdf格式,希望大家喜欢。