求asp.net获取google PR值代码?要最新版的
求asp.net获取google PR值代码?要最新版的
------解决方案--------------------
/// <summary>
/// Google
/// </summary>
/// <returns></returns>
public int getGoogle()
{
string strUrl = "http://www.google.cn/search?complete=1&hl=zh-CN&meta=&q=site%3A" + this.Url;
NetHelper text = new NetHelper();
text.TimeOut = 1000;
string str = 采集网页的html
if (return2.State != 1)
{
return -1;
}
string str2 = strForm2S( str "约有 <b>", "</b> 项符合").Replace(",", "");
try
{
return Convert.ToInt32(str2);
}
catch
{
return -1;
}
}
public static string strForm2S(string sstr, string s, string e)
{
string str = "";
int index = sstr.IndexOf(s, 0);
if (index >= 0)
{
int num2 = sstr.IndexOf(e, index);
if (num2 >= 0)
{
str = sstr.Substring(index + s.Length, (num2 - index) - s.Length);
}
}
return str;
}
------解决方案--------------------/// <summary>
/// Google
/// </summary>
/// <returns></returns>
public int getGoogle()
{
string strUrl = "http://www.google.cn/search?complete=1&hl=zh-CN&meta=&q=site%3A" + this.Url;
NetHelper text = new NetHelper();
text.TimeOut = 1000;
string str = 采集网页的html
if (return2.State != 1)
{
return -1;
}
string str2 = strForm2S( str "约有 <b>", "</b> 项符合").Replace(",", "");
try
{
return Convert.ToInt32(str2);
}
catch
{
return -1;
}
}
public static string strForm2S(string sstr, string s, string e)
{
string str = "";
int index = sstr.IndexOf(s, 0);
if (index >= 0)
{
int num2 = sstr.IndexOf(e, index);
if (num2 >= 0)
{
str = sstr.Substring(index + s.Length, (num2 - index) - s.Length);
}
}
return str;
}
------解决方案--------------------mark+UP
------解决方案--------------------Up
------解决方案--------------------关注中,顶
------解决方案--------------------不懂 友情UP一下
------解决方案--------------------好像还真不能用
------解决方案---------------------_-@ 怎么不能用?
我的网站就用这个代码.
------解决方案--------------------
------解决方案--------------------
c# asp.net获取google pr值源代码