模拟一个连接来自搜索引擎

首先添加引用Microsoft.mshtml.dll和WatiN.Core.dll

using WatiN.Core;  

string live = "http://cnweb.search.live.com/results.aspx?q=test&go=&form=QBLH";

                IE ie = new IE(live);
                Link link = ie.Links[2];
                ((mshtml.HTMLAnchorElementClass)(link.HTMLElement)).href = "http://lovebanyi.cnblogs.com/?";

                link.Click();
                ie.Close();

什么地方会用到这个呢:

做流量统计的时候,

当一个页面来源于google ,baidu时的特殊提示或处理。

推广作弊

原文地址:https://www.cnblogs.com/lovebanyi/p/1408771.html