GetWindowsPath() public static method

Windows Directory의 경로를 구한다. (C:\Windows)
public static GetWindowsPath ( ) : string
return string
Ejemplo n.º 1
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());
 }
Ejemplo n.º 2
0
        public void ToBase64Test()
        {
            var di        = new DirectoryInfo(FileTool.GetWindowsPath());
            var fileInfos = di.GetFiles("*.ini");

            if (fileInfos.Any())
            {
                string srcFile  = fileInfos[0].FullName;
                string destFile = Path.Combine(FileTool.GetWindowsPath(), "tested_file.txt");

                string base64String = srcFile.Base64Encode();
                Console.WriteLine("base64String : " + base64String);
                var buffer = base64String.Base64Decode();
                FileTool.Save(destFile, buffer, true);
                destFile.DeleteFile(true);
            }
        }