想在指定目錄創建一個檔案,目錄有可能不存在,用這個函式可以一次性實作目錄和檔案的創建嗎?
uj5u.com熱心網友回復:
CreateFileThe CreateFile function creates or opens the following objects and returns a handle that can be used to access the object:
files
pipes
mailslots
communications resources
disk devices (Windows NT only)
consoles
directories (open only)
uj5u.com熱心網友回復:
創建目錄 使用 CreateDirectoryuj5u.com熱心網友回復:
不行,因為很多程式是用CreateFile判斷目錄是否存在的。如果CreateFile的時候順便把目錄也創建了會造成這些程式出錯。用SHCreateDirectory可以一次性創建多層目錄。
uj5u.com熱心網友回復:
CreateDirectory 創建目錄用這個轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/65467.html
標籤:基礎類
