예제 #1
0
        //IEnvironment env;

        public ImplHandlerLog(IEnvironment pEnv)
        {
            // env = pEnv;
            try
            {
                if (!ToolMobile.existsDir(_dir))
                {
                    ToolMobile.createDir(_dir);
                }

                string[] arr = ToolMobile.getFiles(_dir);
                if (arr.Length > 30)
                {
                    List <string> files = new List <string>(arr);
                    files.Sort();
                    for (int i = 0; i < files.Count - 5; ++i)
                    {
                        ToolMobile.deleteFile(_dir, files[i]);
                    }
                }
            }
            catch //(Exception exc)
            {
            }
        }
예제 #2
0
        public override string[] getFiles(string dir)
        {
            string path = correctPath(dir, string.Empty);

            //
            string[] arr = ToolMobile.getFiles(path);
            for (int i = 0; i < arr.Length; ++i)
            {
                arr[i] = Path.GetFileName(arr[i]);
            }
            return(arr);
        }