
2个回答
展开全部
调用Win32 API函数CreateDirectory(),例如在c盘创建一个“123”的文件夹: CreateDirectory("C:\\123",NULL); 接受2个参数,第一个为存在的路径,第2个一般为NULL。 需要头文件Winbace.h,需要链接库Coredll.lib。 下面是msdn的原文: BOOL CreateDirectory( LPCTSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes ); Parameters lpPathName [in] Long pointer to a null-terminated string that specifies the pathof the directory to be created. There is a default string size limit for paths of MAX_PATH characters. Thislimit is related to how the CreateDirectory function parses paths. lpSecurityAttributes [in] Ignored; set to NULL. Return Values Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError. Remarks Some file systems, such as NTFS file system, support compression or encryption for individual files and directories. On volumes formatted for such a file system, a new directory inherits the compression and encryptionattributes of its parent directory. Requirements OS Versions: Windows CE 1.0 and later. Header: Winbase.h. Link Library: Coredll.lib. See Also CeCreateDirectory (RAPI) | CreateFile | RemoveDirectory
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询