資料夾操作

2021-04-24 17:58:23 字數 533 閱讀 3129

建立資料夾:

char buf[256];

::getcurrentdirectory(256,buf); //獲取程式根目錄路徑

m_name.getwindowtext(name);

strcat(buf,"//");

strcat(buf,name);

createdirectory(buf,null);

刪除資料夾:

char buf[256];

::getcurrentdirectory(256,buf);

m_name.getwindowtext(name);

strcat(buf,"//");

strcat(buf,name);

removedirectory(buf);

獲取系統資料夾路徑: getsystemdirectory(buf,256);

獲取windows路徑:getwindowsdirectory(buf,256);

在建立資料夾時,上一級資料夾必須存在,不能建立乙個包含子資料夾的資料夾

檔案(夾)操作

對檔案和資料夾操作的類 1.fileinfo具體檔案,使用此類的物件,可以獲得問價大小等各種資訊 繼承自filesysteminfo 建立物件,fileinfo fi new fileinfo 常用屬性 name 檔名稱 extension 副檔名 fullname 檔案完全路徑 物理路徑 leng...

拷貝檔案 資料夾 建立資料夾 刪除資料夾操作

qt拷貝檔案 資料夾 建立資料夾 刪除資料夾操作 cpp view plain copy brief 拷貝檔案到目的資料夾 param srcfilename 原始檔全路徑,比如 f tx wwxx.txt f tx des desd param desfilepathname 要copy到的目的路...

Delphi 資料夾操作

uses shellapi 建立資料夾 procedure tfrmmain.cxbutton1click sender tobject begin createdirectory pchar extractfilepath paramstr 0 microblue nil end 刪除資料夾,放到...