GetTempPath() 공개 정적인 메소드

시스템의 Temporary Directory를 반환한다. (C:\Documents and Settings\Administrator\Local Settings\Temp)
public static GetTempPath ( ) : string
리턴 string
예제 #1
0
        public void GetDirectorySizeTest()
        {
            string tempPath = FileTool.GetTempPath();
            long   size     = tempPath.GetDirectorySize(true);

            Console.Write(size.ToString("#,##0") + " bytes");
        }
예제 #2
0
 public void GetPathTest()
 {
     Console.WriteLine("Temp FilePath: {0}", FileTool.GetTempPath());
     Console.WriteLine("CurrentPath: {0}", FileTool.GetCurrentPath());
     Console.WriteLine("SystemPath: {0}", FileTool.GetSystemPath());
     Console.WriteLine("WindowsPath: {0}", FileTool.GetWindowsPath());
     Console.WriteLine("ProgramFilesPath: {0}", FileTool.GetProgramFilesPath());
 }
예제 #3
0
        public void SearchTest()
        {
            var dirs = FileTool.GetDirectories(FileTool.GetTempPath(), "*");

            Console.Write("Dir: " + dirs.Length + "; ");

            var files = FileTool.GetFiles(FileTool.GetTempPath(), "*");

            Console.Write("File: " + files.Length + "; ");
        }
예제 #4
0
        public void CopyAndMoveDirectory()
        {
            string       srcPath  = FileTool.GetTempPath();
            const string copyPath = @"C:\Temp\Test of CopyDirectory";
            const string movePath = @"C:\Temp\Test of MoveDirectory";

            srcPath.CopyDirectory(copyPath, true);
            Console.WriteLine("CopyDirectory(\"{0}\", \"{1}\", true) was done.", srcPath, copyPath);

            movePath.DeleteDirectory();

            copyPath.MoveDirectory(movePath);
            Console.WriteLine("MoveDirectory(\"{0}\", \"{1}\", true) was done.", copyPath, movePath);

            //
            // delete test directories
            //

            movePath.DeleteDirectory(true);
            Console.WriteLine("DeleteDirectory(\"{0}\") was done.", movePath);
        }