标签:
windows_22_windows_Directory 文件系统 - 目录
// windows_22_windows_Directory.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <windows.h>void UseDirectory( ){//创建目录CreateDirectory( "D:\\Test", NULL );//删除目录RemoveDirectory( "D:\\Test2" );//修改文件或者文件夹名称MoveFile( "d:\\Test", "d:\\Test2" );}void ShowDirectory( ){//获取Windows目录CHAR szWindows[MAX_PATH] = { 0 };GetWindowsDirectory( szWindows, MAX_PATH );//当前系统安装目录printf( "WindowsDirectory: %s\n", szWindows );//获取System目录CHAR szSystem[MAX_PATH] = { 0 };GetSystemDirectory( szSystem, MAX_PATH );printf( "SystemDirectory: %s\n", szSystem );//获取临时文件的路径CHAR szTemp[MAX_PATH] = { 0 };GetTempPath( MAX_PATH, szTemp );printf( "TempPath: %s\n", szTemp );//获取应用程序当前目录CHAR szCurrent[MAX_PATH] = {0};GetCurrentDirectory( MAX_PATH, szCurrent );printf( "CurrentDirectory: %s\n", szCurrent );//设置当前目录SetCurrentDirectory( "c:\\" );GetCurrentDirectory( MAX_PATH, szCurrent );printf( "CurrentDirectory: %s\n", szCurrent );}int _tmain(int argc, _TCHAR* argv[]){ShowDirectory( );UseDirectory( );return 0;}
23 windows_22_windows_Directory 文件系统 - 目录
标签:
原文地址:http://www.cnblogs.com/nfking/p/5573347.html