How to realize the copy and deletion of files in PB

zhaozj2021-02-08  224

How to implement the copy and deletion of the file in the PB, can be used with external functions

API function can be implemented:

1, file copy

Function declaration:

Function Boolean Copyfilea (Ref String CFROM, REF STRING CTO, Boolean Flag) Library "kernel32.dll"

transfer:

String ls_source, ls_des

Boolean LB_FLAG, LB_RTN

LB_FLAG = FALSE

Ls_source = "c: /book.xls" // Source file

LS_DES = "C: /TMP/111.xls" // Target File

LB_RTN = CopyFilea (LS_Source, LS_DES, LB_FLAG)

Messagebox ("file copy", string (lb_rtn))

2. Delete files

Function declaration:

Function Boolean Deletefilea (Ref string filename) library "kernel32.dll"

transfer:

String ls_file

Boolean LB_RTN

LS_FILE = "C: /TMP/111.xls"

lb_rtn = deletefilea (ls_file)

MessageBox ("File Delete", String (LB_RTN))

Or use the PB itself FileDelete () to delete the file.

转载请注明原文地址:https://www.9cbs.com/read-2388.html

New Post(0)