public void GetDirectorySizeTest() { string tempPath = FileTool.GetTempPath(); long size = tempPath.GetDirectorySize(true); Console.Write(size.ToString("#,##0") + " bytes"); }
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()); }
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 + "; "); }
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); }