資源簡介
自制DISCUZ論壇頂貼器源碼
程序介紹:
基于WINFORM的自動論壇頂貼器
包括網頁登錄,驗證用戶.客戶端登錄驗證
基于WINFORM的 HTTP請求模擬提交參數直接發貼,刪貼功能
自動頂貼內容可不重復,并且絕對干凈,每頂一次會刪掉上次自頂貼的信息.但不影響手動發貼效果.運行方式為定時后臺監控.
監控運行時,自動保存已經掃描貼子數,程序關閉重新打開繼續上次掃描結果繼續.全部公開源碼.

代碼片段和文件信息
using?System;
using?System.Collections;
namespace?HtmlAgilityPack.Samples
{
class?GetDoclinks
{
[STAThread]
static?void?Main(string[]?args)
{
HtmlWeb?hw?=?new?HtmlWeb();
string?url?=?@“http://www.microsoft.com“;
HtmlDocument?doc?=?hw.Load(url);
doc.Save(“mshome.htm“);
DocumentWithlinks?nwl?=?new?DocumentWithlinks(doc);
Console.WriteLine(“linked?urls:“);
for(int?i=0;inks.Count;i++)
{
Console.WriteLine(nwl.links[i]);
}
Console.WriteLine(“Referenced?urls:“);
for(int?i=0;i {
Console.WriteLine(nwl.References[i]);
}
}
}
///?
///?Represents?a?document?that?needs?linked?files?to?be?rendered?such?as?images?or?css?files?and?points?to?other?HTML?documents.
///?
public?class?DocumentWithlinks
{
private?ArrayList?_links;
private?ArrayList?_references;
private?HtmlDocument?_doc;
///?
///?Creates?an?instance?of?a?DocumentWithlinkedFiles.
///?
///?The?input?HTML?document.?May?not?be?null.
public?DocumentWithlinks(HtmlDocument?doc)
{
if?(doc?==?null)
{
throw?new?ArgumentNullException(“doc“);
}
_doc?=?doc;
Getlinks();
GetReferences();
}
private?void?Getlinks()
{
_links?=?new?ArrayList();
HtmlNodeCollection?atts?=?_doc.DocumentNode.SelectNodes(“//*[@background?or?@lowsrc?or?@src?or?@href]“);
if?(atts?==?null)
return;
foreach(HtmlNode?n?in?atts)
{
Parselink(n?“background“);
Parselink(n?“href“);
Parselink(n?“src“);
Parselink(n?“lowsrc“);
}
}
private?void?GetReferences()
{
_references?=?new?ArrayList();
HtmlNodeCollection?hrefs?=?_doc.DocumentNode.SelectNodes(“//a[@href]“);
if?(hrefs?==?null)
return;
foreach(HtmlNode?href?in?hrefs)
{
_references.Add(href.Attributes[“href“].Value);
}
}
private?void?Parselink(HtmlNode?node?string?name)
{
HtmlAttribute?att?=?node.Attributes[name];
if?(att?==?null)
return;
//?if?name?=?href?we?are?only?interested?by?nk>?tags
if?((name?==?“href“)?&&?(node.Name?!=?“link“))
return;
_links.Add(att.Value);
}
///?
///?Gets?a?list?of?links?as?they?are?declared?in?the?HTML?document.
///?
public?ArrayList?links
{
get
{
return?_links;
}
}
///?
///?Gets?a?list?of?reference?links?to?other?HTML?documents?as?they?are?declared?in?the?HTML?document.
///?
public?ArrayList?References
{
get
{
return?_references;
}
}
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1423??2012-01-31?09:02??Topics.sln
?????文件???????25088??2012-01-31?09:02??Topics.suo
?????文件?????????123??2012-01-31?09:02??最新Asp.Net源碼下載.url
?????文件??????203838??2012-01-31?09:02??HtmlAgilityPack\HtmlAgilityPack.chm
?????文件????????4470??2012-01-31?09:02??HtmlAgilityPack\HtmlAgilityPack.sln
?????文件?????????596??2012-01-31?09:02??HtmlAgilityPack\HtmlAgilityPack.snk
?????文件???????33792??2012-01-31?09:02??HtmlAgilityPack\HtmlAgilityPack.suo
?????文件????????2690??2012-01-31?09:02??HtmlAgilityPack\GetDocli
?????文件????????2253??2012-01-31?09:02??HtmlAgilityPack\GetDocli
?????文件??????266240??2012-01-31?09:02??HtmlAgilityPack\GetDocli
?????文件???????15872??2012-01-31?09:02??HtmlAgilityPack\GetDocli
?????文件??????102400??2012-01-31?09:02??HtmlAgilityPack\GetDocli
?????文件??????251392??2012-01-31?09:02??HtmlAgilityPack\GetDocli
?????文件?????????212??2012-01-31?09:02??HtmlAgilityPack\GetDocli
?????文件??????266240??2012-01-31?09:02??HtmlAgilityPack\GetDocli
?????文件???????15872??2012-01-31?09:02??HtmlAgilityPack\GetDocli
?????文件????????4039??2012-01-31?09:02??HtmlAgilityPack\GetDocli
?????文件????????1267??2012-01-31?09:02??HtmlAgilityPack\GetDocli
?????文件????????3632??2012-01-31?09:02??HtmlAgilityPack\Html2Rss\Html2Rss.cs
?????文件????????2324??2012-01-31?09:02??HtmlAgilityPack\Html2Rss\Html2Rss.csproj
?????文件?????????698??2012-01-31?09:02??HtmlAgilityPack\Html2Rss\www.asp.net.ToRss.xsl
?????文件??????270336??2012-01-31?09:02??HtmlAgilityPack\Html2Rss\bin\Debug\Html2Rss.exe
?????文件???????13824??2012-01-31?09:02??HtmlAgilityPack\Html2Rss\bin\Debug\Html2Rss.pdb
?????文件???????14328??2012-01-31?09:02??HtmlAgilityPack\Html2Rss\bin\Debug\Html2Rss.vshost.exe
?????文件?????????490??2012-01-31?09:02??HtmlAgilityPack\Html2Rss\bin\Debug\Html2Rss.vshost.exe.manifest
?????文件??????102400??2012-01-31?09:02??HtmlAgilityPack\Html2Rss\bin\Debug\HtmlAgilityPack.dll
?????文件??????251392??2012-01-31?09:02??HtmlAgilityPack\Html2Rss\bin\Debug\HtmlAgilityPack.pdb
?????文件???????????0??2012-01-31?09:02??HtmlAgilityPack\Html2Rss\bin\Debug\rss.xm
?????文件?????????698??2012-01-31?09:02??HtmlAgilityPack\Html2Rss\bin\Debug\www.asp.net.ToRss.xsl
?????文件?????????200??2012-01-31?09:02??HtmlAgilityPack\Html2Rss\obj\Html2Rss.csproj.FileList.txt
?????文件?????????156??2012-01-31?09:02??HtmlAgilityPack\Html2Rss\obj\Debug\Html2Rss.csproj.FileListAbsolute.txt
............此處省略145個文件信息
- 上一篇:c#編寫的物資管理信息系統
- 下一篇:自己用的商店收銀系統
評論
共有 條評論