示例#1
0
        public bool LoadLinksFromFile(string vsPath)
        {
            cFile oLogger = new cFile("LoadLinksFromFile.Log");

            try
            {
                // oLogger.Write("++++++++++++++++++++++++++");
                //   oLogger.Write(vsPath);
                // oLogger.Write("++++++++++++++++++++++++++");
                cFile oFile = new cFile(vsPath);
                //oFile.FileName = ;
                List <String> sNewUrlList = oFile.ReadList();
                Parallel.For(0, sNewUrlList.Count, x =>
                {
                    string sUrl1 = sNewUrlList[x];
                    // oLogger.Write(sUrl1);
                    // oLogger.Write("-----" + iCnt1.ToString() + "-----");
                    msUrlList.Add(sUrl1);;
                });

                return(true);
            }

            catch (Exception ex)
            {
                oLogger.WriteLog(ex.Message, "LoadLinksFromFileError.log");
                throw ex;
            }
            //throw new NotImplementedException();
        }
示例#2
0
 public bool SortLinks(string vsPath)
 {
     try
     {
         cFile  oFile   = new cFile(vsPath);
         string sFFdef1 = "http://m.fanfiction.net/s/";
         string sFFdef2 = "https://m.fanfiction.net/s/";
         //oFile.FileName = ;
         List <String> sUrlList = oFile.ReadList();
         for (int iCnt = 0; iCnt < sUrlList.Count(); iCnt++)
         {
             // if (sUrlList[iCnt].Substring(0, 26) == "http://m.fanfiction.net/s/")
             // {
             if ((sUrlList[iCnt].Substring(0, 26) == sFFdef1) || (sUrlList[iCnt].Substring(0, 27) == sFFdef2))
             {
                 // }
             }
             return(true);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return(false);
 }
示例#3
0
 public bool LoadLinksFromFile(string vsPath)
 {
     try
     {
         cFile oLogger = new cFile("Error.txt");
         oLogger.Write("++++++++++++++++++++++++++");
         oLogger.Write(vsPath);
         oLogger.Write("++++++++++++++++++++++++++");
         cFile oFile = new cFile(vsPath);
         //oFile.FileName = ;
         List <String> sNewUrlList = oFile.ReadList();
         for (int iCnt1 = 0; iCnt1 < sNewUrlList.Count(); iCnt1++)
         {
             oLogger.Write("-----" + iCnt1.ToString() + "-----");
             string sUrl1 = sNewUrlList[iCnt1];
             oLogger.Write(sUrl1);
             oLogger.Write("-----" + iCnt1.ToString() + "-----");
             if (sUrl1.Length >= 28)
             {
                 sUrl1 = FixFFdotNet(sUrl1);
             }
             if (sUrl1.Length >= 5)
             {
                 msUrlList.Add(sUrl1);;
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     //throw new NotImplementedException();
 }
示例#4
0
        public List <String> GetLinksFromFile(string vsPath)
        {
            cFile oFile = new cFile(vsPath);
            //oFile.FileName = ;
            List <String> sUrlList = oFile.ReadList();

            return(sUrlList);
            //throw new NotImplementedException();
        }
 public bool GetLinkFilesFromFile(string spath)
 {
     try
     {
         cFile oFile = new cFile(spath);
         oFilesList = oFile.ReadList();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
     return(false);
 }
 public bool ReadLinksFromTextFiles()
 {
     foreach (var sFile in oFilesList)
     {
         try
         {
             cFile oFile = new cFile(sFile);
             oUrListList.AddRange(oFile.ReadList());
         }
         catch (Exception)
         {
             return(false);
         }
     }
     return(true);
 }
示例#7
0
 public bool SortLinks(string vsPath)
 {
     try
     {
         cFile oFile = new cFile(vsPath);
         //oFile.FileName = ;
         List <String> sUrlList = oFile.ReadList();
         for (int iCnt = 0; iCnt < sUrlList.Count(); iCnt++)
         {
             if (sUrlList[iCnt].Substring(0, 26) == "http://m.fanfiction.net/s/")
             {
             }
         }
         return(true);
     }
     catch
     {
         throw; //ex;
     }
 }
示例#8
0
 public bool SortFFdotNet(string vsPath)
 {
     try
     {
         cFile oFile = new cFile(vsPath);
         //oFile.FileName = ;
         List <String> sUrlList = oFile.ReadList();
         for (int iCnt = 0; iCnt < sUrlList.Count(); iCnt++)
         {
             if (sUrlList[iCnt].Substring(0, 26) == "http://m.fanfiction.net/s/")
             {
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     throw new System.NotImplementedException();
 }
示例#9
0
        public bool LoadToFile(string vsPath)
        {
            cFile oFile = new cFile(vsPath);

            try
            {
                List <String> sNewUrlList = oFile.ReadList();
                Parallel.For(0, sNewUrlList.Count, x =>
                {
                    string sUrl1 = sNewUrlList[x];
                    oFile.SaveLink(sUrl1, msExportedLinkPath);
                });
                oFile.Delete();

                return(true);
            }

            catch (Exception ex)
            {
                throw ex;
            }
            //throw new NotImplementedException();
        }