예제 #1
0
        /// <summary>
        /// 返回根目录
        /// </summary>
        /// <param name="u"></param>
        public static void root(User u)
        {
            string tpath = ConstValue.userpath + u.GetName() + @"\file\home";

            u.SetPath(LogicalParser.parse(tpath, u));
            u.SetSinglePath(LogicalParser.singleParse(u));
        }
        public static User GetInstance(string name)
        {
            User newUser = new User(name);

            newUser.SetPath(LogicalParser.parse(newUser.GetPath(), newUser));
            newUser.nowSinglePath = LogicalParser.singleParse(newUser);
            return(newUser);
        }
예제 #3
0
        /// <summary>
        /// 返回上一级目录
        /// </summary>
        /// <param name="u"></param>
        public static void back(User u)
        {
            string tpath = TruepathParser.parse(u);
            int    point = tpath.LastIndexOf(@"\");

            tpath = tpath.Substring(0, point);
            u.SetPath(LogicalParser.parse(tpath, u));
            u.SetSinglePath(LogicalParser.singleParse(u));
        }
        /// <summary>
        /// 更新索引表.
        /// </summary>
        /// <param name="u"></param>
        public static void Update(User u)
        {
            string[]      fds = FDfiner.find(TruepathParser.parse(u)).Split('\n');
            StringBuilder sb  = new StringBuilder();

            foreach (string fd in fds)
            {
                sb.AppendLine(LogicalParser.parse(fd, u));
            }
            IndexTableWriter.Write(u, sb.ToString(), false);
        }