1、檔案複製 函式宣告: FUNCTION boolean CopyFileA(ref string cfrom, ref string cto, boolean flag) LIBRARY "Kernel32.dll" 呼叫: string ls_source, ls_des boolean lb_flag, lb_rtn lb_flag = false ls_source = "c:ook.xls" //原始檔 ls_des = "C: mpI.xls" //目標檔案 lb_rtn = CopyFileA(ls_source, ls_des, lb_flag) MessageBox("檔案複製", string(lb_rtn))
2、刪除檔案 函式宣告: FUNCTION boolean DeleteFileA(ref string filename) LIBRARY "Kernel32.dll" 呼叫: string ls_file boolean lb_rtn ls_file = "C: mpI.xls" lb_rtn = DeleteFileA(ls_file) MessageBox("檔案刪除", string(lb_rtn)) 或者用PB本身的函式FileDelete()來刪除檔案。 -
1、檔案複製 函式宣告: FUNCTION boolean CopyFileA(ref string cfrom, ref string cto, boolean flag) LIBRARY "Kernel32.dll" 呼叫: string ls_source, ls_des boolean lb_flag, lb_rtn lb_flag = false ls_source = "c:ook.xls" //原始檔 ls_des = "C: mpI.xls" //目標檔案 lb_rtn = CopyFileA(ls_source, ls_des, lb_flag) MessageBox("檔案複製", string(lb_rtn))
2、刪除檔案 函式宣告: FUNCTION boolean DeleteFileA(ref string filename) LIBRARY "Kernel32.dll" 呼叫: string ls_file boolean lb_rtn ls_file = "C: mpI.xls" lb_rtn = DeleteFileA(ls_file) MessageBox("檔案刪除", string(lb_rtn)) 或者用PB本身的函式FileDelete()來刪除檔案。 -