C 分析搜尋引擎url 得到搜尋關鍵字

2021-05-23 21:14:35 字數 2246 閱讀 2889

using system;

using system.collections.generic;

using system.text;

using system.text.regularexpressions;

namespace util

//搜尋引擎特徵

private string _enginers = new string

,new string,

new string,

new string,

new string,

new string,

new string,

new string,

new string,

new string,

new string,

new string,

new string,

new string,

new string,

new string,

new string,

new string,

new string

};//搜尋引擎名稱

private string _enginename = 」";

public string enginename

}//搜尋引擎編碼

private string _coding = 」utf8″;

public string coding

}//搜尋引擎關鍵字查詢引數名稱

private string _regexword = 」";

public string regexword

}private string _regex = @」(「;

//搜尋引擎關鍵字

//建立搜尋關鍵字正規表示式

public void engineregex(string mystring)}}

//得到搜尋引擎關鍵字

public string searchkey(string mystring)

else

}return mystring;

}//整句轉碼

public string getutf8string(string mystring)

return mystring;

}//單字gb2312轉utf8 url編碼

public string gb2312toutf8(string mystring)

;encoding gb = encoding.getencoding(「gb2312″);

encoding u8 = encoding.utf8;

mybyte = encoding.convert(gb, u8, mybyte);

char chars = new char[u8.getcharcount(mybyte, 0, mybyte.length)];

u8.getchars(mybyte, 0, mybyte.length, chars, 0);

return new string(chars);

}//判斷否為搜尋引擎爬蟲,並返回其型別

public string iscrawler(string systeminfo)

;

foreach (string bot in botlist)

}

return 」null」;

}

public bool issearchenginesget(string str)

;

str = str.tolower();

for (int i = 0; i < strarray.length; i++)

}

return false;

}

}

}

呼叫方法:

//判斷是否搜尋引擎鏈結

C 分析搜尋引擎url 得到搜尋關鍵字

using system using system.collections.generic using system.linq using system.text using system.text.regularexpressions using system.web namespace hbtu...

搜尋引擎優化 URL重寫

rhel下弄得我半夜腦子裡全是命令,halt都停不下來,直接失眠了。昨天一天不敢進紅帽系統,在windows下研究負載均衡理論寫了一天 明天就能動手試試了,晚上看了些seo優化,動手試了試,雖不多也是學習啊。常規的php字串操作函式的執行比正規表示式要快很多,因此只有需要的時候才使用後者。例如,如果...

Nutch搜尋引擎分析

quote 一 系統架構 總體上nutch可以分為2個部分 抓取部分和搜尋部分。抓取程式抓取頁面並把抓取回來的資料做成反向索引,搜尋程式則對反向索引搜尋回答使用者的請求。抓取程式和搜尋程式的介面是索引,兩者都使用索引中的字段。抓取程式和搜尋程式可以分別位於不同的機器上。下面詳細介紹一下抓取部分。抓取...