Exemple #1
0
        private string GetCrmPath(string localfile)
        {
            if (!localfile.StartsWith(RootFolder, StringComparison.OrdinalIgnoreCase))
            {
                throw new FileLoadException("File not under root folder", localfile);
            }

            var crmpath = Prefix + (Prefix.EndsWith("_") ? "" : "_") + "/";

            crmpath += localfile.Replace(RootFolder.EndsWith("\\") ? RootFolder : RootFolder + "\\", "").Replace("\\", "/");
            return(crmpath);
        }
Exemple #2
0
 public myFTP(string server, string user, string password, string folder)
 {
     Server     = server;
     User       = user;
     Password   = password;
     RootFolder = folder.Trim();
     if (RootFolder == null)
     {
         RootFolder = "";
     }
     ;
     if (RootFolder.Length > 0 && !RootFolder.StartsWith("/"))
     {
         RootFolder = "/" + RootFolder;
     }
     ;
     if (RootFolder.EndsWith("/"))
     {
         RootFolder = RootFolder.Substring(0, RootFolder.Length - 1);
     }
 }
Exemple #3
0
        public static void ProcessDir(string dir, string ver = null)
        {
            ver      = ver ?? FindVer(dir) ?? DateTime.UtcNow.ToShortDateString();
            DVersion = ver;
            Console.WriteLine($"version: {ver}");
            TOP = TOP.Replace("%VER%", ver);

            RootFolder = Path.GetFullPath(dir);
            if (!RootFolder.EndsWith("" + Path.DirectorySeparatorChar))
            {
                RootFolder += Path.DirectorySeparatorChar;
            }

            ParseDir(RootFolder);
            Console.WriteLine("\n");

            IndexDir(RootFolder);
            SaveIndex(CombineDir(RootFolder, "Index.hhk"));
            Console.WriteLine("\n");

            BooksFromDir(RootFolder);
            Console.WriteLine("\n");
        }