23 windows_22_windows_Directory 文件系统 - 目录
Posted 养老保险年审
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了23 windows_22_windows_Directory 文件系统 - 目录相关的知识,希望对你有一定的参考价值。
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 文件系统 - 目录的主要内容,如果未能解决你的问题,请参考以下文章
Windows基础环境_安装配置教程(Windows7 64JDK1.8Android SDK23.0TortoiseSVN 1.9.5)