23 windows_22_windows_Directory 文件系统 - 目录

Posted 养老保险年审

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了23 windows_22_windows_Directory 文件系统 - 目录相关的知识,希望对你有一定的参考价值。

windows_22_windows_Directory 文件系统 - 目录

  1. // windows_22_windows_Directory.cpp : 定义控制台应用程序的入口点。
  2. //
  3. #include "stdafx.h"
  4. #include <windows.h>
  5. void UseDirectory( )
  6. {
  7. //创建目录
  8. CreateDirectory( "D:\\Test", NULL );
  9. //删除目录
  10. RemoveDirectory( "D:\\Test2" );
  11. //修改文件或者文件夹名称
  12. MoveFile( "d:\\Test", "d:\\Test2" );
  13. }
  14. void ShowDirectory( )
  15. {
  16. //获取Windows目录
  17. CHAR szWindows[MAX_PATH] = { 0 };
  18. GetWindowsDirectory( szWindows, MAX_PATH );//当前系统安装目录
  19. printf( "WindowsDirectory: %s\n", szWindows );
  20. //获取System目录
  21. CHAR szSystem[MAX_PATH] = { 0 };
  22. GetSystemDirectory( szSystem, MAX_PATH );
  23. printf( "SystemDirectory: %s\n", szSystem );
  24. //获取临时文件的路径
  25. CHAR szTemp[MAX_PATH] = { 0 };
  26. GetTempPath( MAX_PATH, szTemp );
  27. printf( "TempPath: %s\n", szTemp );
  28. //获取应用程序当前目录
  29. CHAR szCurrent[MAX_PATH] = {0};
  30. GetCurrentDirectory( MAX_PATH, szCurrent );
  31. printf( "CurrentDirectory: %s\n", szCurrent );
  32. //设置当前目录
  33. SetCurrentDirectory( "c:\\" );
  34. GetCurrentDirectory( MAX_PATH, szCurrent );
  35. printf( "CurrentDirectory: %s\n", szCurrent );
  36. }
  37. int _tmain(int argc, _TCHAR* argv[])
  38. {
  39. ShowDirectory( );
  40. UseDirectory( );
  41. return 0;
  42. }





以上是关于23 windows_22_windows_Directory 文件系统 - 目录的主要内容,如果未能解决你的问题,请参考以下文章

22.dll调用技术

笔记|LaTex

Windows基础环境_安装配置教程(Windows7 64JDK1.8Android SDK23.0TortoiseSVN 1.9.5)

22. pt-sift

39.Android版本小知识

请教windows下,安装sqlite3的方法