BOOL CreateDirectory(
LPCTSTR lpPathName, // pointer to directory path string
LPSECURITY_ATTRIBUTES lpSecurityAttributes // pointer to security descriptor
);
LPCTSTR lpPathName, // pointer to directory path string
LPSECURITY_ATTRIBUTES lpSecurityAttributes // pointer to security descriptor
);
解决方案 »
- ADO 获取数据库BYTE类型值 这样是否可以呢
- 合肥程序员请进
- 如何向MSFlexGrid中插入数据
- 请教高手:视图被拖动之后的坐标定位问题
- 请问如何知道窗口的状态是不是最小化?
- 关于怎样调用word(解决了可以多给分)
- 拦截API的问题!请大家进来鄙视一下!
- VC中使用MSCOMM实现串口通信,串口初始化、打开及OncommMscomm()函数是如何实现的?那位能给讲讲
- 关于win32dll消息钩子的问题
- char buf; buf=0xa5; TRACE("%x",buf); 为什么输出: ffffffa5;如何去掉ffffff?
- 用ADOQUERY为何不能带参数删除??
- 100分求《Inside Server-based Applications》一书的配套代码。
int _mkdir( const char *dirname );
{
HANDLE fFile; // File Handle
WIN32_FIND_DATA fileinfo; // File Information Structure
CStringArray m_arr; // Cstring Array to hold Directory Structures
BOOL tt; // BOOL used to test if Create Directory was successful
int x1 = 0; // Counter
CString tem = ""; // Temporary Cstring Object // Before we go to a lot of work.
// Does the file exist fFile = FindFirstFile(dd,&fileinfo); // if the file exists and it is a directory
if(fileinfo.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
{
// Directory Exists close file and return
FindClose(fFile);
return TRUE;
} m_arr.RemoveAll(); // Not really necessary - Just habit
for(x1=0;x1<dd.GetLength();x1++) // Parse the supplied Cstring Directory String
{
if(dd.GetAt(x1) != '\\') // if the Character is not a \
tem += dd.GetAt(x1); // else add character to Temp String
else
{
m_arr.Add(tem); // if the Character is a \ Add the Temp String to the Cstring Array
tem += "\\"; // Now add the \ to the temp string
}
if(x1 == dd.GetLength()-1) // If we reached the end of the file add the remaining string
m_arr.Add(tem);
}
// Close the file
FindClose(fFile);
// Now lets cycle through the String Array and create each directory in turn
for(x1 = 1;x1<m_arr.GetSize();x1++)
{
tem = m_arr.GetAt(x1);
tt = CreateDirectory(tem,NULL); // If the Directory exists it will return a false
if(tt)
SetFileAttributes(tem,FILE_ATTRIBUTE_NORMAL);
// If we were successful we set the attributes to normal
}
m_arr.RemoveAll();
// Now lets see if the directory was successfully created
fFile = FindFirstFile(dd,&fileinfo); // if the file exists and it is a directory
if(fileinfo.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
{
// Directory Exists close file and return
FindClose(fFile);
return TRUE;
}
else
{
FindClose(fFile);
return FALSE;
}
}
呵呵
LPCTSTR lpPathName, // directory name
LPSECURITY_ATTRIBUTES lpSecurityAttributes // SD
);