在Windows環境下打開文件的方式有很多種.下面一一列舉
1.C語言:
函數FILE fopen(const char* path, const char* mode);
2.C++語言:
fstream類:fstream file;file.open(const char* filename, ios_base::openmode);
3.Windows系統API:
int _open(const char* filename, int oflag[, int mode]);
4.Windows系統API:
HANDLE WINAPI CreateFile(
__in LPCTSTR lpFileName,
__in DWORD dwDesiredAccess,
__in DWORD dwShareMode,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD dwCreationDisposition,
__in DWORD dwFlagsAndAttributes,
__in_opt HANDLE hTemplateFile
);