日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

百度网盘搜索工具_2019

發(fā)布時間:2023/12/8 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 百度网盘搜索工具_2019 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

百度網盤搜索工具

1.寫在前面

經常搜索百度網盤里的資源,以前做了個數(shù)據(jù)來源來自盤多多,現(xiàn)在不能使用了。所以就又找了一個搜索網站史萊姆http://www.slimego.cn。

2.分析

通過獲得查詢頁面的源數(shù)據(jù),得到記錄總數(shù),分頁數(shù),搜索數(shù)據(jù)集合。

3.程序實現(xiàn)

下面將貼出實現(xiàn)該程序的關鍵代碼。

1 /// <summary> 2 /// 通過正則表達式獲得百度網盤文件 3 /// </summary> 4 private void GetNetFilesDo() 5 { 6 string Keyword = TextBoxKeyword.Text.Trim(); 7 string url = string.Format("http://www.slimego.cn/search.html?q={0}&page=1&rows=20", Keyword); 8 string html = GetHtmlContent(url); 9 10 //獲得總頁數(shù)和總記錄數(shù) 11 GetPageInfo(html); 12 Invoke(new SetProgressMaxDelegate(SetProgressMax), RecordCount); 13 if (RecordCount <= 0) 14 { 15 Invoke(new SetButtonStartDelegate(SetButtonStart), true); 16 return; 17 } 18 19 //循環(huán)頁面 20 for (int i = 1; i <= PageCount; i++) 21 { 22 if (i >= 2)//第1頁已經查到了,就不用查了 23 { 24 url = string.Format("http://www.slimego.cn/search.html?q={0}&page={1}&rows=20", Keyword, i); 25 html = GetHtmlContent(url); 26 } 27 28 int seeks = html.IndexOf("<div style=\"display:table\">");//開始位置 29 int seeke = html.IndexOf("<div id=\"pagesplit\" class=\"m-pagination\"></div>");//結束位置 30 string content = html.Substring(seeks + 0, seeke - seeks - 15).Trim(); 31 Regex rxGetInfo = new Regex("<div style=\"display: table-cell\" class=\"searchCell\">.*?</div>", RegexOptions.Singleline); 32 MatchCollection matches = rxGetInfo.Matches(content); 33 34 //循環(huán)每1頁 35 for (int j = 0; j < matches.Count; j++) 36 { 37 if (matches[j].Success) 38 { 39 string strMatch = matches[j].Value; 40 41 MatchCollection match1 = Regex.Matches(strMatch, "<a rel=\"noreferrer\".*?</a>", RegexOptions.Singleline);//文件名 42 MatchCollection match2 = Regex.Matches(strMatch, "<span class=\"ftype\">.*?</span>");//類別 43 MatchCollection match3 = Regex.Matches(strMatch, "<span class=\"size\">.*?</span>");//大小 44 MatchCollection match4 = Regex.Matches(strMatch, "<span class=\"upload\">.*?</span>");//時間 45 MatchCollection match5 = Regex.Matches(strMatch, "<a rel=\"noreferrer\".*?</a>", RegexOptions.Singleline);//文件地址 46 MatchCollection match6 = Regex.Matches(strMatch, "<span class=\"home\">.*?</span>", RegexOptions.Singleline);//分享地址 47 if (match1 == null || match2 == null || match3 == null || match4 == null || match5 == null || match6 == null) continue; 48 49 50 NetFileInfo file = new NetFileInfo(); 51 file.ID = (i - 1) * PageSize + j + 1; 52 file.FileFullName = CommonLib.RemoveHTML(match1[0].Value).Trim(); 53 file.FileName = file.FileFullName; 54 file.ExtName = GetExtName(file.FileFullName); 55 file.Tag = GetTypeName(file.ExtName); 56 file.FileSize = CommonLib.RemoveHTML(match3[0].Value); 57 string TimeSize = CommonLib.RemoveHTML(match4[0].Value);//上傳: 2018年07月20日 07時27分 58 TimeSize = TimeSize.Substring(TimeSize.IndexOf(" ") + 1, TimeSize.LastIndexOf(" ") - 4); 59 file.FileTime = TimeSize; 60 file.ShareFileSite = GetShareFileSite(match1[0].Value); 61 string ShareName = CommonLib.RemoveHTML(match6[0].Value).Replace("查看用戶", "").Replace("的所有分享", ""); 62 file.ShareName = ShareName; 63 file.ShareSite = GetShareSite(match6[0].Value); 64 65 Invoke(new GridRowAddDelegate(GridRowAdd), file); 66 Invoke(new SetProgressDelegate(SetProgress), file.ID); 67 } 68 } 69 } 70 71 Invoke(new SetButtonStartDelegate(SetButtonStart), true); 72 } View Code

4.程序界面

5.功能

1、搜索任意名稱的百度網盤共享文件。
2、鼠標左鍵雙擊打開網盤地址。
3、鼠標右鍵點擊彈出上下文菜單。打開、復制網盤地址及打開、復制分享者主頁。
4、可以導出搜索結果。

下載地址:https://pan.baidu.com/s/16RidPx2VLn7CCUHcQ-aPCw

轉載于:https://www.cnblogs.com/zhangwc/p/11451983.html

總結

以上是生活随笔為你收集整理的百度网盘搜索工具_2019的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。