亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

用ASP實(shí)現(xiàn)遠(yuǎn)程將文件批量改名的代碼

 更新時(shí)間:2007年09月01日 19:08:25   作者:  
<% @LANGUAGE = VBSCRIPT %>
<%Option Explicit%>
<%
'以下程序批量改名文件夾中的文件名,并將所有文件移動(dòng)到新的文件夾;
Response.Write "<html>" & VbCrLf & "<head>" & VbCrLf
Response.Write "<title>批量文件改名</title>" & VbCrLf
Response.Write "</head>" & VbCrLf & "<body>" & VbCrLf
' 變量說(shuō)明
Dim gbolGoProcedure
Dim strFromDir '源文件夾
Dim strTargetDir '目標(biāo)文件夾
Dim objFS
Dim objRootFolder
Dim objFile
Dim strFileNameLen
Dim strPrevFileName
Dim strFileExt '文件擴(kuò)展名
Dim strFileNameCount
Dim strNewFileName
Dim strRealCount '處理的文件數(shù)量

gbolGoProcedure = False

' 如果點(diǎn)擊了開(kāi)始按鈕,進(jìn)行以下處理
If (Request.Form("GoButton")) = " 開(kāi) 始 " then

' 指定源文件夾、目標(biāo)文件夾

 strFromDir = "D:test\"
 strTargetDir = "D:\test1\"

 ' 將處理文件數(shù)量設(shè)置為0

 strRealCount = 0

 Set objFS = Server.CreateObject("Scripting.FileSystemObject")

 Set objRootFolder = objFS.GetFolder(strTargetDir)
 '文件名的具體設(shè)置,這里設(shè)置為100001,表明文件名將從100001
 '開(kāi)始,逐步遞增,可以根據(jù)需要設(shè)置;
 strFileNameCount = 100001
For each objFile in objRootFolder.Files
 '對(duì)于特定的文件,不進(jìn)行處理,可以根據(jù)需要設(shè)置;
 If objFile.Name = "Thumbs.db" then strFileNameCount = StrFileNameCount - 1
 strFileNameCount = strFileNameCount + 1
Next

Set objRootFolder = objFS.GetFolder(strFromDir)
For each objFile in objRootFolder.Files
 strFileNameLen = Len (objFile.Name)
 If Mid (objFile.Name,(strFileNameLen - 3),1) = "." then
  strFileExt = right(objFile.Name, 4)
 Else
  strFileExt = right(objFile.Name, 5)
 End If

 strPrevFileName = objFile.Name
 strNewFileName = strFileNameCount & strFileExt

 objFile.Move strTargetDir & strNewFileName

 Response.Write "源文件: " &strFromDir&strPrevFileName & " > 移動(dòng)并改名為: " &strTargetDir& strNewFileName & "<br>" & vbCrLF
 strFileNameCount = strFileNameCount + 1
 strRealCount = strRealCount + 1

Next

 Response.Write "<p><b>一共處理: " & (strRealCount) & " 個(gè)文件</B>" & vbCrLf

 Set objRootFolder = Nothing
 Set objFS = Nothing

 gbolGoProcedure = True

End If

If gbolGoProcedure Then
 Response.Write("<p><b>批量文件批量移動(dòng)和改名</b>") & vbCrLf

Else
 Response.Write("<center><br><form method=""post"" action=""FileNameConverter.asp""  ID=form1 name=""form1"">") & vbCrLf
 Response.Write("<input type=""SUBMIT"" value="" 開(kāi) 始 "" ID=""GoButton""  name=""GoButton"">") & vbCrLf
 Response.Write("</form>") & vbCrLf
 Response.Write("<p><b>點(diǎn)擊按鈕對(duì)文件進(jìn)行批量移動(dòng)和改名</b></center>") & VbCrLf
End If

Response.Write "</body>" & VbCrLf & "</html>"

%>

相關(guān)文章

最新評(píng)論