Ejemplo n.º 1
0
 public void addpage(string input, int pagedepth, Page previous)
 {
     if (input == "==Error occured==") return;
     if ((input.IndexOf("http://") == -1) && (input.IndexOf("https://") == -1))
     {
         if (input[0] != '/') input=input.Insert(0, "/");
         input=input.Insert(0, domain);
     }
     pages.Add(new Page(input, pagedepth, previous));
 }
Ejemplo n.º 2
0
 public Page(string input, int pagedepth, Page prev)
 {
     motherpage = prev;
     url = input;
     depth = pagedepth;
     try
     {
         WebRequest request = WebRequest.Create(url);
         WebResponse responce = request.GetResponse();
         Stream data = responce.GetResponseStream();
         StreamReader read = new StreamReader(data);
         content = read.ReadToEnd();
         responce.Close();
         data.Close();
         read.Close();
         request.Abort();
     }
     catch
     {
         links.Add(new Link("==Error occured=="));
         return;
     }
     search(content);
 }