Пример #1
0
        public static WhoIsInfo GetDomainInfo(string domain, string page)
        {
            const string tag = "<pre>";

             WhoIsInfo info = new WhoIsInfo();
             info.Domain = domain;
             info.Info = "Unable to get whois information";

             int fromPos = page.IndexOf(tag);
             if(fromPos != -1)
             {
            int tillPos = page.IndexOf(tag, fromPos + 1);

            if(tillPos != -1)
            {
               fromPos += tag.Length;
               info.Info = page.Substring(fromPos, tillPos - fromPos);

               info.Emails = "";
               string[] emails = ExtractEmails(info.Info);

               if(emails.Length != 0)
               {
                  for(int i = 0; i < emails.Length - 1; i++)
                  {
                     info.Emails += emails[i];
                     info.Emails += ", ";
                  }
                  info.Emails += emails[emails.Length -1];
               }
            }
             }

             return info;
        }
 public void AddDomain(WhoIsInfo info)
 {
     domains.Add(info);
 }