问题描述
我还是个初学者
私有声明函数SearchTreeForFile库"imagehlp"(ByVal RootPath作为字符串,ByVal InputPathName作为字符串,ByVal OutputPathBuffer作为字符串)
私有常量MAX_PATH = 260
私人子Form_Load()
昏暗的tempStr作为字符串,保留Ret作为long
昏暗的file1,file2作为字符串
''创建缓冲区字符串
tempStr =字符串(MAX_PATH,0)
"成功时返回1,失败时返回0
Ret = SearchTreeForFile("c:\ PROGRAM FILES \","Proof.XML",tempStr)
如果Ret<> 0然后
MsgBox" + Left $(tempStr,InStr(1,tempStr,Chr $(0))-1)
Label1.Caption = Left $(tempStr,InStr(1,tempStr,Chr $(0))-1)
其他
MsgBox找不到文件!"
如果结束
结束子
如何在找到文件的文件夹中将文件PROOF.XML重命名为PROOF.XML.bak
解决方案如何帮助我
定位我程序
找到名称PROOF.XML
如果发现PROOF.XML重命名为PROOF.XML.bak
如果找到了PROOF.XML.bak而没有找到PROOF.XML,则创建文件PROOF.XML
如果PROOF.XML和PROOF.XML.bak找到完成
如果重命名文件的目标满足目标,则搜索文件夹和文件,并在找到目标的位置创建具有目标名称的新文件"
帮我..please
I''m still a beginner
Private Declare Function SearchTreeForFile Lib "imagehlp" (ByVal RootPath As String, ByVal InputPathName As String, ByVal OutputPathBuffer As String) As Long
Private Const MAX_PATH = 260
Private Sub Form_Load()
Dim tempStr As String, Ret As Long
Dim file1, file2 As String
''create a buffer string
tempStr = String(MAX_PATH, 0)
''returns 1 when successfull, 0 when failed
Ret = SearchTreeForFile("c:\PROGRAM FILES\", "Proof.XML", tempStr)
If Ret <> 0 Then
MsgBox " " + Left$(tempStr, InStr(1, tempStr, Chr$(0)) - 1)
Label1.Caption = Left$(tempStr, InStr(1, tempStr, Chr$(0)) - 1)
Else
MsgBox "File not found!"
End If
End Sub
how rename file PROOF.XML to PROOF.XML.bak in the folder where the files found
how solution help me
target me program
find name PROOF.XML
if PROOF.XML found rename PROOF.XML.bak
if PROOF.XML.bak found and PROOF.XML not found create files PROOF.XML
if PROOF.XML and PROOF.XML.bak found finish
"search folders and files if the target of rename files meet the target and create new files with the name of the target at the location where the target is found"
help me..please
推荐答案
这篇关于如果找到文件Vb6,如何重命名文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!