Ejemplo n.º 1
0
        internal bool InstalledHostFound(ServerConfig s, string hn)
        {
            string k = s.RootDirectory + "\\" + hn;

            k = k.Replace("\\\\", "\\");
            return(AppHelper.ExistedDir(k));
        }
Ejemplo n.º 2
0
        public static string GetRootDirectory(string alter = "")
        {
            string d = global::RykonServer.Properties.Settings.Default.RootDir;

            if (d == "\\RootDir\\" && AppHelper.ExistedDir(alter))
            {
                d = alter + ((!alter.EndsWith("\\RootDir\\"))?"\\RootDir\\":"");
            }

            if (AppHelper.ExistedDir(d) == false)
            {
                d = alter + "\\RootDir\\";
                AppHelper.RepairPath(d, true);
            }
            return(d);
        }
Ejemplo n.º 3
0
        internal static List <Rykonpath> getDirectoryPaths(string dir, string rootdirectory, out int sepindex)
        {
            sepindex = 0;
            try
            {
                if (AppHelper.ExistedDir(dir) == false)
                {
                    dir = AppHelper.RepairPathSlashes(dir);
                    AppHelper.RepairPath(dir);
                }
                if (AppHelper.ExistedDir(dir) == false)
                {
                    return(null);
                }
                List <Rykonpath> resul = new List <Rykonpath>();
                string[]         files = AppHelper.GetFiles(dir);
                string[]         dirs  = AppHelper.GetDirectories(dir);
                if (dirs != null)
                {
                    foreach (string d in dirs)
                    {
                        resul.Add(new Rykonpath(d, Rykonpathtype.directory, rootdirectory));
                    }
                }

                if (files != null)
                {
                    foreach (string f in files)
                    {
                        resul.Add(new Rykonpath(f, Rykonpathtype.File, rootdirectory));
                    }
                }

                sepindex = dirs.Length;
                return(resul);
            }
            catch
            {
                return(null);
            }
        }