PB利用API-SHFileOperation 文件操作函数 实现多文件及文件夹的删除复制等操作
2012-01-30 18:06
911 查看
PB的文件操作能力比较弱,自带的一些函数功能太简单,一遇上些稍微复杂些的需求(如多文件删除,文件夹的删除等)并不是非常好用,所以利用windows的API来实现相应的功能就成了最好的选择,而这其中,SHFileOperation又是最好用的,其实我说的这些并不新鲜,网上也有相关的例子,但是网上现在能找到的例程都是PB10以前的,由于从PB10开始,编码从ANSI改成了UNICODE,所以在参数的传递上,以前的一些东西要稍作下改变才可以继续使用,见到有些朋友对此有疑问,特封装了一对象(PB10以后适用),免得大家重复劳动,浪费时间,而曾经尝试过类似的工作但没有成功的朋友,请注意代码中BLOB,BLOBEDIT,LENA的使用方法,希望对大家理解ansi和unicode之间的转换能有些帮助。
*******************nvo_fileoperation,用户对象,封装了文件操作的相关函数**************************************
forward
global type nvo_fileoperation from nonvisualobject
end type
type str_operation from structure within nvo_fileoperation
end type
type str_fileoperation from structure within nvo_fileoperation
end type
end forward
type str_fileoperation from structure
unsignedlong hwnd
unsignedlong wfunc
blob pfrom
blob pto
unsignedinteger fflags
unsignedlong banyoperationsaborted
unsignedlong hnamemappings
string lpszprogresstitle
end type
global type nvo_fileoperation from nonvisualobject
end type
global nvo_fileoperation nvo_fileoperation
type prototypes
//文件操作,SHFileOperation在 Vista 及以后版本中应替换为iFileOperation
Function long SHFileOperation(ref str_fileoperation lpFileOp) Library "shell32.dll" Alias FOR "SHFileOperationA;ansi"
end prototypes
type variables
Private Constant int FO_MOVE = 1 // &H1
Private Constant int FO_COPY = 2 //&H2
Private Constant int FO_DELETE =3 //&H3
Private Constant int FO_RENAME =4 //&H4
Private Constant int FOF_NOCONFIRMATION =16 //&H10
Private Constant int FOF_SILENT = 4 //&H4
Private Constant int FOF_NOERRORUI = 1024 //&H400
end variables
forward prototypes
public function integer of_delete (string as_sourcefile[], window aw_requestor, long aui_flags)
public function integer of_copy (string as_sourcefile[], string as_target, window aw_requestor, long aui_flags)
public function integer of_move (string as_sourcefile[], string as_target, window aw_requestor, long aui_flags)
public function integer of_rename (string as_sourcefile, string as_targetfile, window aw_requestor, long aui_flags)
end prototypes
public function integer of_delete (string as_sourcefile[], window aw_requestor, long aui_flags);//====================================================================
// 函数: nvo_fileoperation::of_delete
//--------------------------------------------------------------------
// 描述:
//--------------------------------------------------------------------
// 参数:
// string as_sourcefile[] --需要删除的文件名
// window aw_requestor --当前窗口名
// long aui_flags --UI参数(是否显示,是否与用户互动等,意义参见百度SHFileOperation结构参数说明)
//--------------------------------------------------------------------
// 返回值: integer
//--------------------------------------------------------------------
// 作者: sjlion 日期: 2012.01.11
//--------------------------------------------------------------------
// 修改历史:
//
//====================================================================
str_fileoperation lstr_FileOp
Integer li_rc,li_bound,i
blob lb_source,lb_temp
lstr_FileOp.hWnd = Handle(aw_requestor)
lstr_FileOp.wFunc = FO_DELETE
li_bound = upperbound(as_sourcefile[])
for i = 1 to li_bound
lb_temp = blob(as_sourcefile[i]+space(1),EncodingANSI!)
blobedit(lb_temp,Lena( as_SourceFile[i] ) + 1, Char(0),EncodingANSI!)
lb_source = lb_source + lb_temp
next
lb_source = lb_source+blob(char(0),EncodingANSI!)
lstr_FileOp.pFrom =lb_source
//blob(as_sourcefile,EncodingANSI!) + blob(char(0),EncodingANSI!) + blob(char(0),EncodingANSI!)//
//lstr_FileOp.pto = Blob( as_SourceFile + Space(2) )
//BlobEdit( lstr_FileOp.pto, Lena( as_SourceFile ) + 1, Char(0) )
//BlobEdit( lstr_FileOp.pto, Lena( as_SourceFile ) + 2, Char(0) )
lstr_FileOp.fFlags = aui_flags //16 无提示 32 需确认
lstr_FileOp.hNameMappings = 0
lstr_FileOp.lpszProgressTitle = Space(10)
li_rc = SHFileOperation( lstr_FileOp )
IF li_rc <> 0 THEN
IF NOT IsNull( lstr_FileOp ) THEN
IF lstr_FileOp.bAnyOperationsAborted = 1 THEN
RETURN 0
END IF
END IF
ELSE
RETURN -1
END IF
RETURN 1
end function
public function integer of_copy (string as_sourcefile[], string as_target, window aw_requestor, long aui_flags);//====================================================================
// 函数: nvo_fileoperation::of_copy
//--------------------------------------------------------------------
// 描述:
//--------------------------------------------------------------------
// 参数:
// string as_sourcefile[] --需要复制的文件名
// window aw_requestor --当前窗口名
// long aui_flags --UI参数(是否显示,是否与用户互动等,意义参见百度SHFileOperation结构参数说明)
//--------------------------------------------------------------------
// 返回值: integer
//--------------------------------------------------------------------
// 作者: sjlion 日期: 2012.01.11
//--------------------------------------------------------------------
// 修改历史:
//
//====================================================================
str_fileoperation lstr_FileOp
Integer li_rc,li_bound,i
blob lb_source,lb_temp,lb_target
lstr_FileOp.hWnd = Handle(aw_requestor)
lstr_FileOp.wFunc = FO_COPY
li_bound = upperbound(as_sourcefile[])
for i = 1 to li_bound
lb_temp = blob(as_sourcefile[i]+space(1),EncodingANSI!)
blobedit(lb_temp,Lena( as_SourceFile[i] ) + 1, Char(0),EncodingANSI!)
lb_source = lb_source + lb_temp
next
lb_source = lb_source+blob(char(0),EncodingANSI!)
lstr_FileOp.pFrom =lb_source
lstr_FileOp.pto = Blob( as_target + Space(2),EncodingANSI!)
BlobEdit( lstr_FileOp.pto, Lena( as_target ) + 1, Char(0),EncodingANSI!)
BlobEdit( lstr_FileOp.pto, Lena( as_target) + 2, Char(0),EncodingANSI!)
lstr_FileOp.fFlags = aui_flags //16 无提示 32 需确认
lstr_FileOp.hNameMappings = 0
lstr_FileOp.lpszProgressTitle = Space(10)
li_rc = SHFileOperation( lstr_FileOp )
IF li_rc <> 0 THEN
IF NOT IsNull( lstr_FileOp ) THEN
IF lstr_FileOp.bAnyOperationsAborted = 1 THEN
RETURN 0
END IF
END IF
ELSE
RETURN -1
END IF
RETURN 1
end function
public function integer of_move (string as_sourcefile[], string as_target, window aw_requestor, long aui_flags);//====================================================================
// 函数: nvo_fileoperation::of_move
//--------------------------------------------------------------------
// 描述:
//--------------------------------------------------------------------
// 参数:
// string as_sourcefile[] --需要移动的文件名
// window aw_requestor --当前窗口名
// long aui_flags --UI参数(是否显示,是否与用户互动等,意义参见百度SHFileOperation结构参数说明)
//--------------------------------------------------------------------
// 返回值: integer
//--------------------------------------------------------------------
// 作者: sjlion 日期: 2012.01.11
//--------------------------------------------------------------------
// 修改历史:
//
//====================================================================
str_fileoperation lstr_FileOp
Integer li_rc,li_bound,i
blob lb_source,lb_temp
lstr_FileOp.hWnd = Handle(aw_requestor)
lstr_FileOp.wFunc = FO_MOVE
li_bound = upperbound(as_sourcefile[])
for i = 1 to li_bound
lb_temp = blob(as_sourcefile[i]+space(1),EncodingANSI!)
blobedit(lb_temp,Lena( as_SourceFile[i] ) + 1, Char(0),EncodingANSI!)
lb_source = lb_source + lb_temp
next
lb_source = lb_source+blob(char(0),EncodingANSI!)
lstr_FileOp.pFrom =lb_source
lstr_FileOp.pto = Blob( as_target + Space(2),EncodingANSI!)
BlobEdit( lstr_FileOp.pto, Lena( as_target ) + 1, Char(0),EncodingANSI!)
BlobEdit( lstr_FileOp.pto, Lena( as_target) + 2, Char(0),EncodingANSI!)
lstr_FileOp.fFlags = aui_flags //16 无提示 32 需确认
lstr_FileOp.hNameMappings = 0
lstr_FileOp.lpszProgressTitle = Space(10)
li_rc = SHFileOperation( lstr_FileOp )
IF li_rc <> 0 THEN
IF NOT IsNull( lstr_FileOp ) THEN
IF lstr_FileOp.bAnyOperationsAborted = 1 THEN
RETURN 0
END IF
END IF
ELSE
RETURN -1
END IF
RETURN 1
end function
public function integer of_rename (string as_sourcefile, string as_targetfile, window aw_requestor, long aui_flags);//====================================================================
// 函数: nvo_fileoperation::of_rename
//--------------------------------------------------------------------
// 描述:
//--------------------------------------------------------------------
// 参数:
// string as_sourcefile[] --需要重新的文件名列表
// window aw_requestor --当前窗口名
// long aui_flags --UI参数(是否显示,是否与用户互动等,意义参见百度SHFileOperation结构参数说明)
//--------------------------------------------------------------------
// 返回值: integer
//--------------------------------------------------------------------
// 作者: sjlion 日期: 2012.01.11
//--------------------------------------------------------------------
// 修改历史:
//
//====================================================================
str_fileoperation lstr_FileOp
Integer li_rc,li_bound,i
blob lb_source,lb_temp,lb_target
lstr_FileOp.hWnd = Handle(aw_requestor)
lstr_FileOp.wFunc = FO_RENAME
lstr_FileOp.pfrom = Blob( as_sourcefile + Space(2),EncodingANSI!)
BlobEdit( lstr_FileOp.pfrom, Lena( as_sourcefile ) + 1, Char(0),EncodingANSI!)
BlobEdit( lstr_FileOp.pfrom, Lena( as_sourcefile) + 2, Char(0),EncodingANSI!)
lstr_FileOp.pto = Blob( as_targetfile + Space(2),EncodingANSI!)
BlobEdit( lstr_FileOp.pto, Lena( as_targetfile ) + 1, Char(0),EncodingANSI!)
BlobEdit( lstr_FileOp.pto, Lena( as_targetfile) + 2, Char(0),EncodingANSI!)
lstr_FileOp.fFlags = aui_flags//16 无提示 32 需确认
lstr_FileOp.hNameMappings = 0
lstr_FileOp.lpszProgressTitle = Space(10)
li_rc = SHFileOperation( lstr_FileOp )
IF li_rc <> 0 THEN
IF NOT IsNull( lstr_FileOp ) THEN
IF lstr_FileOp.bAnyOperationsAborted = 1 THEN
RETURN 0
END IF
END IF
ELSE
RETURN -1
END IF
RETURN 1
end function
on nvo_fileoperation.create
call super::create
TriggerEvent( this, "constructor" )
end on
on nvo_fileoperation.destroy
TriggerEvent( this, "destructor" )
call super::destroy
end on
********************nvo_fileoperation,用户对象,封装了文件操作的相关函数***********************************************
/====================================================================
// 事件: fileoperation对象应用例程
//--------------------------------------------------------------------
// 描述: delete -- 可删除非空文件夹,可多文件或文件夹操作
// copy --- 可多文件或文件夹件操作
// move-- 可多文件或文件夹操作
// rename -- 只能单文件操作
//--------------------------------------------------------------------
// 参数:
//--------------------------------------------------------------------
// 返回值: long
//--------------------------------------------------------------------
// 作者: sjlion 日期: 2012.01.11
//--------------------------------------------------------------------
// 修改历史:
//
//====================================================================
nvo_fileoperation luo_fileoperation
luo_fileoperation = Create nvo_fileoperation
string ls_copy_from[],ls_copy_to,ls_delete_from[],ls_move_from[],ls_move_to,ls_rename_from,ls_rename_to
ls_copy_from[1] = 'c:\复制1'
ls_copy_from[2] ="c:\复制2"
ls_copy_to = 'd:\'
luo_fileoperation.of_copy(ls_copy_from,ls_copy_to,this,32)
ls_delete_from[1]='c:\复制1'
ls_delete_from[2]='c:\复制2'
luo_fileoperation.of_delete(ls_delete_from,this,32)
ls_move_from[1]='d:\复制1'
ls_move_from[2]='d:\复制2'
ls_move_to = 'f:\'
luo_fileoperation.of_move(ls_move_from,ls_move_to,this,32)
ls_rename_from = 'f:\复制1'
ls_rename_to = 'f:\复制_复制'
luo_fileoperation.of_rename(ls_rename_from,ls_rename_to,this,32)
*******************nvo_fileoperation,用户对象,封装了文件操作的相关函数**************************************
forward
global type nvo_fileoperation from nonvisualobject
end type
type str_operation from structure within nvo_fileoperation
end type
type str_fileoperation from structure within nvo_fileoperation
end type
end forward
type str_fileoperation from structure
unsignedlong hwnd
unsignedlong wfunc
blob pfrom
blob pto
unsignedinteger fflags
unsignedlong banyoperationsaborted
unsignedlong hnamemappings
string lpszprogresstitle
end type
global type nvo_fileoperation from nonvisualobject
end type
global nvo_fileoperation nvo_fileoperation
type prototypes
//文件操作,SHFileOperation在 Vista 及以后版本中应替换为iFileOperation
Function long SHFileOperation(ref str_fileoperation lpFileOp) Library "shell32.dll" Alias FOR "SHFileOperationA;ansi"
end prototypes
type variables
Private Constant int FO_MOVE = 1 // &H1
Private Constant int FO_COPY = 2 //&H2
Private Constant int FO_DELETE =3 //&H3
Private Constant int FO_RENAME =4 //&H4
Private Constant int FOF_NOCONFIRMATION =16 //&H10
Private Constant int FOF_SILENT = 4 //&H4
Private Constant int FOF_NOERRORUI = 1024 //&H400
end variables
forward prototypes
public function integer of_delete (string as_sourcefile[], window aw_requestor, long aui_flags)
public function integer of_copy (string as_sourcefile[], string as_target, window aw_requestor, long aui_flags)
public function integer of_move (string as_sourcefile[], string as_target, window aw_requestor, long aui_flags)
public function integer of_rename (string as_sourcefile, string as_targetfile, window aw_requestor, long aui_flags)
end prototypes
public function integer of_delete (string as_sourcefile[], window aw_requestor, long aui_flags);//====================================================================
// 函数: nvo_fileoperation::of_delete
//--------------------------------------------------------------------
// 描述:
//--------------------------------------------------------------------
// 参数:
// string as_sourcefile[] --需要删除的文件名
// window aw_requestor --当前窗口名
// long aui_flags --UI参数(是否显示,是否与用户互动等,意义参见百度SHFileOperation结构参数说明)
//--------------------------------------------------------------------
// 返回值: integer
//--------------------------------------------------------------------
// 作者: sjlion 日期: 2012.01.11
//--------------------------------------------------------------------
// 修改历史:
//
//====================================================================
str_fileoperation lstr_FileOp
Integer li_rc,li_bound,i
blob lb_source,lb_temp
lstr_FileOp.hWnd = Handle(aw_requestor)
lstr_FileOp.wFunc = FO_DELETE
li_bound = upperbound(as_sourcefile[])
for i = 1 to li_bound
lb_temp = blob(as_sourcefile[i]+space(1),EncodingANSI!)
blobedit(lb_temp,Lena( as_SourceFile[i] ) + 1, Char(0),EncodingANSI!)
lb_source = lb_source + lb_temp
next
lb_source = lb_source+blob(char(0),EncodingANSI!)
lstr_FileOp.pFrom =lb_source
//blob(as_sourcefile,EncodingANSI!) + blob(char(0),EncodingANSI!) + blob(char(0),EncodingANSI!)//
//lstr_FileOp.pto = Blob( as_SourceFile + Space(2) )
//BlobEdit( lstr_FileOp.pto, Lena( as_SourceFile ) + 1, Char(0) )
//BlobEdit( lstr_FileOp.pto, Lena( as_SourceFile ) + 2, Char(0) )
lstr_FileOp.fFlags = aui_flags //16 无提示 32 需确认
lstr_FileOp.hNameMappings = 0
lstr_FileOp.lpszProgressTitle = Space(10)
li_rc = SHFileOperation( lstr_FileOp )
IF li_rc <> 0 THEN
IF NOT IsNull( lstr_FileOp ) THEN
IF lstr_FileOp.bAnyOperationsAborted = 1 THEN
RETURN 0
END IF
END IF
ELSE
RETURN -1
END IF
RETURN 1
end function
public function integer of_copy (string as_sourcefile[], string as_target, window aw_requestor, long aui_flags);//====================================================================
// 函数: nvo_fileoperation::of_copy
//--------------------------------------------------------------------
// 描述:
//--------------------------------------------------------------------
// 参数:
// string as_sourcefile[] --需要复制的文件名
// window aw_requestor --当前窗口名
// long aui_flags --UI参数(是否显示,是否与用户互动等,意义参见百度SHFileOperation结构参数说明)
//--------------------------------------------------------------------
// 返回值: integer
//--------------------------------------------------------------------
// 作者: sjlion 日期: 2012.01.11
//--------------------------------------------------------------------
// 修改历史:
//
//====================================================================
str_fileoperation lstr_FileOp
Integer li_rc,li_bound,i
blob lb_source,lb_temp,lb_target
lstr_FileOp.hWnd = Handle(aw_requestor)
lstr_FileOp.wFunc = FO_COPY
li_bound = upperbound(as_sourcefile[])
for i = 1 to li_bound
lb_temp = blob(as_sourcefile[i]+space(1),EncodingANSI!)
blobedit(lb_temp,Lena( as_SourceFile[i] ) + 1, Char(0),EncodingANSI!)
lb_source = lb_source + lb_temp
next
lb_source = lb_source+blob(char(0),EncodingANSI!)
lstr_FileOp.pFrom =lb_source
lstr_FileOp.pto = Blob( as_target + Space(2),EncodingANSI!)
BlobEdit( lstr_FileOp.pto, Lena( as_target ) + 1, Char(0),EncodingANSI!)
BlobEdit( lstr_FileOp.pto, Lena( as_target) + 2, Char(0),EncodingANSI!)
lstr_FileOp.fFlags = aui_flags //16 无提示 32 需确认
lstr_FileOp.hNameMappings = 0
lstr_FileOp.lpszProgressTitle = Space(10)
li_rc = SHFileOperation( lstr_FileOp )
IF li_rc <> 0 THEN
IF NOT IsNull( lstr_FileOp ) THEN
IF lstr_FileOp.bAnyOperationsAborted = 1 THEN
RETURN 0
END IF
END IF
ELSE
RETURN -1
END IF
RETURN 1
end function
public function integer of_move (string as_sourcefile[], string as_target, window aw_requestor, long aui_flags);//====================================================================
// 函数: nvo_fileoperation::of_move
//--------------------------------------------------------------------
// 描述:
//--------------------------------------------------------------------
// 参数:
// string as_sourcefile[] --需要移动的文件名
// window aw_requestor --当前窗口名
// long aui_flags --UI参数(是否显示,是否与用户互动等,意义参见百度SHFileOperation结构参数说明)
//--------------------------------------------------------------------
// 返回值: integer
//--------------------------------------------------------------------
// 作者: sjlion 日期: 2012.01.11
//--------------------------------------------------------------------
// 修改历史:
//
//====================================================================
str_fileoperation lstr_FileOp
Integer li_rc,li_bound,i
blob lb_source,lb_temp
lstr_FileOp.hWnd = Handle(aw_requestor)
lstr_FileOp.wFunc = FO_MOVE
li_bound = upperbound(as_sourcefile[])
for i = 1 to li_bound
lb_temp = blob(as_sourcefile[i]+space(1),EncodingANSI!)
blobedit(lb_temp,Lena( as_SourceFile[i] ) + 1, Char(0),EncodingANSI!)
lb_source = lb_source + lb_temp
next
lb_source = lb_source+blob(char(0),EncodingANSI!)
lstr_FileOp.pFrom =lb_source
lstr_FileOp.pto = Blob( as_target + Space(2),EncodingANSI!)
BlobEdit( lstr_FileOp.pto, Lena( as_target ) + 1, Char(0),EncodingANSI!)
BlobEdit( lstr_FileOp.pto, Lena( as_target) + 2, Char(0),EncodingANSI!)
lstr_FileOp.fFlags = aui_flags //16 无提示 32 需确认
lstr_FileOp.hNameMappings = 0
lstr_FileOp.lpszProgressTitle = Space(10)
li_rc = SHFileOperation( lstr_FileOp )
IF li_rc <> 0 THEN
IF NOT IsNull( lstr_FileOp ) THEN
IF lstr_FileOp.bAnyOperationsAborted = 1 THEN
RETURN 0
END IF
END IF
ELSE
RETURN -1
END IF
RETURN 1
end function
public function integer of_rename (string as_sourcefile, string as_targetfile, window aw_requestor, long aui_flags);//====================================================================
// 函数: nvo_fileoperation::of_rename
//--------------------------------------------------------------------
// 描述:
//--------------------------------------------------------------------
// 参数:
// string as_sourcefile[] --需要重新的文件名列表
// window aw_requestor --当前窗口名
// long aui_flags --UI参数(是否显示,是否与用户互动等,意义参见百度SHFileOperation结构参数说明)
//--------------------------------------------------------------------
// 返回值: integer
//--------------------------------------------------------------------
// 作者: sjlion 日期: 2012.01.11
//--------------------------------------------------------------------
// 修改历史:
//
//====================================================================
str_fileoperation lstr_FileOp
Integer li_rc,li_bound,i
blob lb_source,lb_temp,lb_target
lstr_FileOp.hWnd = Handle(aw_requestor)
lstr_FileOp.wFunc = FO_RENAME
lstr_FileOp.pfrom = Blob( as_sourcefile + Space(2),EncodingANSI!)
BlobEdit( lstr_FileOp.pfrom, Lena( as_sourcefile ) + 1, Char(0),EncodingANSI!)
BlobEdit( lstr_FileOp.pfrom, Lena( as_sourcefile) + 2, Char(0),EncodingANSI!)
lstr_FileOp.pto = Blob( as_targetfile + Space(2),EncodingANSI!)
BlobEdit( lstr_FileOp.pto, Lena( as_targetfile ) + 1, Char(0),EncodingANSI!)
BlobEdit( lstr_FileOp.pto, Lena( as_targetfile) + 2, Char(0),EncodingANSI!)
lstr_FileOp.fFlags = aui_flags//16 无提示 32 需确认
lstr_FileOp.hNameMappings = 0
lstr_FileOp.lpszProgressTitle = Space(10)
li_rc = SHFileOperation( lstr_FileOp )
IF li_rc <> 0 THEN
IF NOT IsNull( lstr_FileOp ) THEN
IF lstr_FileOp.bAnyOperationsAborted = 1 THEN
RETURN 0
END IF
END IF
ELSE
RETURN -1
END IF
RETURN 1
end function
on nvo_fileoperation.create
call super::create
TriggerEvent( this, "constructor" )
end on
on nvo_fileoperation.destroy
TriggerEvent( this, "destructor" )
call super::destroy
end on
********************nvo_fileoperation,用户对象,封装了文件操作的相关函数***********************************************
/====================================================================
// 事件: fileoperation对象应用例程
//--------------------------------------------------------------------
// 描述: delete -- 可删除非空文件夹,可多文件或文件夹操作
// copy --- 可多文件或文件夹件操作
// move-- 可多文件或文件夹操作
// rename -- 只能单文件操作
//--------------------------------------------------------------------
// 参数:
//--------------------------------------------------------------------
// 返回值: long
//--------------------------------------------------------------------
// 作者: sjlion 日期: 2012.01.11
//--------------------------------------------------------------------
// 修改历史:
//
//====================================================================
nvo_fileoperation luo_fileoperation
luo_fileoperation = Create nvo_fileoperation
string ls_copy_from[],ls_copy_to,ls_delete_from[],ls_move_from[],ls_move_to,ls_rename_from,ls_rename_to
ls_copy_from[1] = 'c:\复制1'
ls_copy_from[2] ="c:\复制2"
ls_copy_to = 'd:\'
luo_fileoperation.of_copy(ls_copy_from,ls_copy_to,this,32)
ls_delete_from[1]='c:\复制1'
ls_delete_from[2]='c:\复制2'
luo_fileoperation.of_delete(ls_delete_from,this,32)
ls_move_from[1]='d:\复制1'
ls_move_from[2]='d:\复制2'
ls_move_to = 'f:\'
luo_fileoperation.of_move(ls_move_from,ls_move_to,this,32)
ls_rename_from = 'f:\复制1'
ls_rename_to = 'f:\复制_复制'
luo_fileoperation.of_rename(ls_rename_from,ls_rename_to,this,32)
相关文章推荐
- SHFileOperation()函数移动,复制,删除文件\文件夹
- PHP操作文件类的函数代码(文件和文件夹创建,复制,移动和删除)
- asp下利用fso实现文件夹或文件移动改名等操作函数
- asp下利用fso实现文件夹或文件移动改名等操作函数
- shellapi的SHFileOperation()的外壳函数,用它可以实现各种文件操作,如文件的拷贝、删除、移动等
- Shell的文件操作函数SHFileOperation 移动,复制,删除文件
- asp结合fso实现文件或文件夹创建删除等操作的函数
- php(创建、删除、移动、复制)文件及文件夹操作的实现方法
- SHFileOperation()的外壳函数,用它可以实现各种文件操作,如文件的拷贝、删除、移动等
- asp结合fso实现文件或文件夹创建删除等操作的函数
- PHP操作文件类的函数代码(文件和文件夹创建,复制,移动和删除)
- 实现Vector容器的增加、删除、排序(算法函数排序)、遍历、复制操作
- C#File类常用的文件操作方法(创建、移动、删除、复制等) File类,是一个静态类,主要是来提供一些函数库用的。静态实用类,提供了很多静态的方法,支持对文件的基本操作,包括创建,拷贝,移动,删除和
- 用C#操作文件/文件夹(删除,复制,移动)
- 用python实现文件夹文件读取及删除操作
- java文件和文件夹复制、删除、移动操作
- Ubuntu下C语言实现以子进程号命名的文件及文件夹的新建、删除等操作。
- 文件和文件夹操作(复制,剪切,删除)
- PHP递归实现文件夹的复制、删除、查看大小操作示例
- python中对文件、文件夹(文件操作函数)的操作 整理API