在wince5.0上实现文件或文件夹的删除
源代码在线查看: filehandle.h
// FileHandle.h: interface for the CFileHandle class.
//
//////////////////////////////////////////////////////////////////////
/***************************作者信息*************************************/
/* Name: Nack Li */
/* EMail: lhtn.com@163.com */
/* MSN: lhtnNack@hotmail.com */
/****************************author Info*********************************/
#if !defined(AFX_FILEHANDLE_H__E083727A_5960_4B1C_B8E0_8C0C2A6FA5E1__INCLUDED_)
#define AFX_FILEHANDLE_H__E083727A_5960_4B1C_B8E0_8C0C2A6FA5E1__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifdef FILE_HANDLE_IMPORT
#define FILE_HANDLE_IMPORT __declspec(dllimport)
#else
#define FILE_HANDLE_IMPORT __declspec(dllexport)
#endif
/***********************************************************************************/
typedef struct _FILE_NUN
{
DWORD FolderNum;
DWORD FileNum;
DWORD FileSize;
}FILE_NUM,*LPFILE_NUM;
#define NackZEROMEM(ZeroMem) memset(&ZeroMem,0,sizeof(ZeroMem))
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
/***********************************************************************************/
class FILE_HANDLE_IMPORT CFileHandle
{
public:
void WriteProfileInt(const char *filename,
const char *section,
const char *key,
int value);
void WriteProfileString(const char *filename,
const char *section,
const char *key,
const char *pszWriteStr);
void WriteProfileDouble(const char *filename,
const char *section,
const char *key,
double value);
void GetProfileString(const char *filename,
const char *section,
const char *key,
const char *defaultStr,
char *pszRetStr);
int GetProfileInt(const char *filename,
const char *section,
const char *key,
int defaultValue);
double GetProfileDouble(const char *filename,
const char *section,
const char *key,
double defaultValue);
BOOL DeleteAllFileAndFolder(TCHAR * szFileName);
void CountFileSize(TCHAR *szFileName,LPFILE_NUM FileNum);
void GetRunExePath(TCHAR *strFolderPath);
BOOL SetDirSysUpdateTime(LPTSTR DirName, LPSYSTEMTIME NewTime);
BOOL SetDirSysCreateTime(LPTSTR DirName, LPSYSTEMTIME NewTime);
BOOL SetDirSysAccessTime(LPTSTR DirName, LPSYSTEMTIME NewTime);
BOOL GetDirSysAccessTime(LPTSTR DirName, LPSYSTEMTIME stime);
BOOL GetDirSysUpdateTime(LPTSTR DirName,LPSYSTEMTIME stime);
BOOL GetDirSysCreateTime(LPTSTR DirName,LPSYSTEMTIME stime);
DWORD CopyAllFileAndFolder(TCHAR * szDest, TCHAR * szSrc);
CFileHandle();
virtual ~CFileHandle();
};
#endif // !defined(AFX_FILEHANDLE_H__E083727A_5960_4B1C_B8E0_8C0C2A6FA5E1__INCLUDED_)