#include <direct.h> #include <stdlib.h> #include <stdio.h> int main( void ) { char path[_MAX_PATH]; // _MAX_PATH is defined in windows.h sprintf(path,"D:\\testtmp"); if( _mkdir( path ) == 0 ) { printf( "資料夾'D:\\testtmp'新增成功\n" ); system( "dir D:\\testtmp" ); system("pause"); if( _rmdir( path ) == 0 ) printf( "資料夾'D:\\testtmp'移除成功\n" ); else printf( "無法移除'D:\\testtmp'\n" ); } else printf( "無法新增'D:\\testtmp'\n" ); system("pause"); }
Reference:
http://msdn.microsoft.com/en-us/library/2fkk4dzw(v=VS.90).aspx
沒有留言:
張貼留言