Windows環境打開文件的方式總結

在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
);

 

發佈了20 篇原創文章 · 獲贊 11 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章