예제 #1
0
 private void readTld(FileInfo tFile)
 {
     try
     {
         string line;
         using (StreamReader sr = tFile.OpenText())
         {
             string   header   = sr.ReadLine();
             long     version  = parseVersion(header);
             TldCache newCache = new TldCache(version, header);
             if (cache != null && cache.getVersion >= version)
             {
                 return;
             }
             while ((line = sr.ReadLine()) != null)
             {
                 if (line.StartsWith("#"))
                 {
                     continue;
                 }
                 newCache.addTld(line.Trim());
             }
             cache = newCache;
         }
     }
     catch (Exception e)
     {
         throw new TLDVerifyException(e);
     }
 }
예제 #2
0
 private void readTld(FileInfo tFile)
 {
     try
     {
         string line;
         using (StreamReader sr = tFile.OpenText())
         {
             string header = sr.ReadLine();
             long version = parseVersion(header);
             TldCache newCache = new TldCache(version, header);
             if (cache != null && cache.getVersion >= version)
             {
                 return;
             }
             while ((line = sr.ReadLine()) != null)
             {
                 if (line.StartsWith("#"))
                 {
                     continue;
                 }
                 newCache.addTld(line.Trim());
             }
             cache = newCache;
         }
     }
     catch (Exception e)
     {
         throw new TLDVerifyException(e);
     }
 }