[Program bar www.qhttl.com] lazy library and template King collection artifacts, www.qhttl.com Library
The Code is a collector developed by Asp.net. The collection function is not very powerful. It was collected and written last year. It is not perfect, but can be collected and downloaded. The collection method uses regular expressions.
The code is not explained in detail. You can study the collected code by yourself.
The Code was written last year.
Don't talk nonsense: first go to: lazy gallery collection
The source code seems to have been encrypted. If there is encryption, enter the decompression password: www.qhttl.com homepage effect:
Collection result entity:
public class JsModel { public string Name { get; set; } public string Remark { get; set; } public string Code { get; set; } public string Type { get; set; } public byte[] FileData { get; set; } public string File { get; set; } public string Image { get; set; } public byte[] ImageData { get; set; } public int ID { get; set; } public bool IsDownFile { get; set; } }
Js collection source code:
The code can be used to implement Thief in a unified manner. It mainly collects the Get () function ()
Public class JsLr: Thief {protected string Link {get {return base. getAttr ("config/lanren/js") ;}} protected string Encod {get {return base. getNodeText ("config/lanren/js/Encoder") ;}} protected string [] ErrorPage {get {return base. getNodeText ("config/lanren/js/errorPage "). split (',') ;}} private int PageIndex; private static JsLr this_JsLr; public static JsLr Create () {if (this_JsLr = nu Ll) {this_JsLr = new JsLr ();} return this_JsLr;} private JsLr () {Jses = new Queue <Model. jsModel> (); _ dir = Context. server. mapPath ("/Download/"); PageIndex = 1; IsComplate = false; // GetJsAsync = new Thread (GetJsAll); // DownAsync = new Thread (DownFile );} private bool isErrorPage () {foreach (string s in ErrorPage) {if (s = PageIndex. toString () {return true;} return false;} public overr Ide void Get () {if (IsAsync) {// if (GetJsAsync. threadState = ThreadState. abortRequested | GetJsAsync. threadState = ThreadState. aborted) GetJsAsync = new Thread (GetJsAll); GetJsAsync. start ();} else GetJsAll ();} private void GetJsAll () {if (! IsComplate) {if (isErrorPage () {PageIndex ++; GetJsAll ();} string html = GetHttpString (string. format (Link, PageIndex), Encod); html = html. replace ("\ n ",""). replace ("\ r ",""). replace ("\ t", ""); if (html. contains ("class = \" zuozhe \ "") {Model. jsModel model = new Model. jsModel (); model. type = "js"; model. name = DelHtml (ReplaceEx (html, "<div [^ <>] * title. *? <H1> (? <Name> .*?) </H1> "," name "). Replace ("/"," _ "). Replace (" \ "," _ "); if (! String. IsNullOrEmpty (model. Name )&&! File. Exists (_ dir + "js/" + model. Name + ". zip ")&&! File. exists (_ dir + "js/" + "Html/" + model. name + ". html ") {// get the downloaded file address model. file = ReplaceEx (html, "<a [^ <>] * bt-green. *? Href .*? [\ "'] (? <Url> .*?) [\ "']. *?>. *? </A> "," url "); if (! String. IsNullOrEmpty (model. File) & model. File! = "#") {Model. IsDownFile = true; model. File =" http://www.lanrentuku.com "+ Model. file; // string [] images = ReplaceEx (html, "<div [^ <>] * class = ['\"] l [' \ "]. *? Img .*? Src .*? [\ "'] (? <Image> .*?) [\ "']. *?> ") Model. Image = ReplaceEx (html," <div .*? Content-js .*? [^ <>] * Class = ['\ "] l [' \"]. *? Img .*? Src .*? [\ "'] (? <Image> .*?) [\ "']. *?> "," Image ");} else {model. Remark = ReplaceEx (html," <div [^ <>] * content-tx .*? Textarea. *?> (? <Remark> .*?) </Textarea> "," remark "). replace ("lazy Gallery", "program "). replace ("lanw.uku.com", "qhttl.cn");} model. ID = PageIndex; lock (Jses) {Jses. enqueue (model);} // SendThiefModel (model); lock (MsgList) {MsgList. enqueue (new Model. msgModel () {Type = "js", IsDown = false, Model = model});} Thread. sleep (50); // rest} PageIndex ++; GetJsAll () ;}} this. isComplate = true; if (IsAsync) {Thread. currentThread. abort () ;}} public override void DownLoad () {if (IsAsync) {// if (DownAsync. threadState = ThreadState. abortRequested | DownAsync. threadState = ThreadState. aborted) DownAsync = new Thread (DownFile); DownAsync. start () ;}else DownFile ();}}
Material collection:
Public class ScLr: Thief {protected string Link {get {return base. getAttr ("config/lanren/SC") ;}} protected string Encod {get {return base. getNodeText ("config/lanren/SC/Encoder") ;}} protected string [] ErrorPage {get {return base. getNodeText ("config/lanren/SC/errorPage "). split (',') ;}} private string [] TypeSc = new string [] {"bg", "gif", "psd", "qq", "png ", "vector"}; private string Cu RrType {get; set;} private int PageIndex; private int Count; private static ScLr this_scLr; public static ScLr Create () {if (this_scLr = null) this_scLr = new ScLr (); return this_scLr;} private ScLr () {Jses = new Queue <Model. jsModel> (); _ dir = Context. server. mapPath ("/Download/"); PageIndex = 1; IsComplate = false; // GetJsAsync = new Thread (GetScByType); // DownAsync = new Thread (DownFile );} Public override void Get () {if (IsAsync) {// if (GetJsAsync. threadState = ThreadState. abortRequested | GetJsAsync. threadState = ThreadState. aborted) GetJsAsync = new Thread (GetScByType); GetJsAsync. start ();} else GetScAll ();} public override void DownLoad () {if (IsAsync) {// if (DownAsync. threadState = ThreadState. abortRequested | DownAsync. threadState = ThreadState. aborted) DownAsync = New Thread (DownFile); DownAsync. start ();} else DownFile ();} private bool isErrorPage () {foreach (string s in ErrorPage) {if (s = PageIndex. toString () {return true ;}} return false;} private void GetScByType () {if (! IsComplate) {foreach (string s in TypeSc) {CurrType = s; PageIndex = 1; GetScAll () ;}} this. isComplate = true; if (IsAsync) {Thread. currentThread. abort () ;}} private void GetScAll () {if (isErrorPage () {PageIndex ++; GetScAll () ;}string html = GetHttpString (string. format (Link, PageIndex, CurrType), Encod); html = html. replace ("\ n ",""). replace ("\ r ",""). replace ("\ t", ""); string ddes = Repla CeEx (html, "<div [^ <>] *? List-pic .*? </Div> ", 0); // ReplaceEx (html," list-pic .*? (? <Dds> <dd .*? /Dd> ).*? /Div> "," dds "); string [] dds = ReplaceEx (ddes," <dd .*? /Dd> "); foreach (string s in dds) {JsModel model = new JsModel (); model. ID = ++ Count; model. type = CurrType; model. name = ReplaceEx (s, "<. *> (? <Name> [^ <>] *) </a> "," name "). replace ("/","_"). replace ("\", "_"); model. image = ReplaceEx (s, "<. * src. *? [\ "'] (? <Src> .*?) [\ "']. *? </A> "," src "); if (! Model. Image. Contains (" http://img.lanrentuku.com ") {Model. Image =" http://img.lanrentuku.com "+ Model. Image;} string link = ReplaceEx (s," <a [^ <>] * href .*? [\ "'] (? <Href> .*?) [\ "']. *? </A> "," href "); html = GetHttpString (" http://www.lanrentuku.com "+ Link, Encod); if (! String. IsNullOrEmpty (model. Name )&&! File. exists (_ dir + CurrType + "/" + model. name + ". zip ") {// get the downloaded file address model. file = ReplaceEx (html, "<a [^ <>] * bt-green. *? Href .*? [\ "'] (? <Url> .*?) [\ "']. *?>. *? </A> "," url "); if (! String. IsNullOrEmpty (model. File) & model. File! = "#") {Model. isDownFile = true; model. file = model. file;} else {model. remark = ReplaceEx (html, "<div [^ <>] * content-tx. *? Textarea. *?> (? <Remark> .*?) </Textarea> "," remark "). replace ("lazy Gallery", "program "). replace ("lanw.uku.com", "qhttl.cn");} // model. ID = PageIndex; lock (Jses) {Jses. enqueue (model);} // SendThiefModel (model); lock (MsgList) {MsgList. enqueue (new Model. msgModel () {Type = CurrType, IsDown = false, Model = model});} // Thread. sleep (50); // rest two hundred Ms} if (dds. length> 0) {PageIndex ++; GetScAll ();}}}