FSO 파일 대상 소개 및 상용 함수
                                            
 2263 단어  FSO 파일 대상 소개 및 상용 함수
                    
Function reName(sourceName,destName)  
 dim oFso,oFile  
 set oFso=server.createobject("Scripting.FileSystemObject")  
 set oFile=oFso.getFile(Server.mappath(sourceName))  
 oFile.Name=destName  
 Set oFso=Nothing  
 Set oFile=Nothing  
End FunctionFunction FSOdel(fileName)  
 dim fso,f  
 set fso = server.CreateObject("scripting.filesystemobject")  
 f=server.MapPath(fileName)  
 if fso.FileExists(f) then  
 fso.DeleteFile f,true  
 end if  
 set f = nothing  
 set fso = nothing  
End FunctionFunction FSOreplace(fileName,Target,repString)  
 Dim objFSO,objCountFile,FiletempData  
 Set objFSO = Server.CreateObject("Scripting.FileSystemObject")  
 Set objCountFile = objFSO.OpenTextFile(Server.MapPath(fileName),1,True)  
 FiletempData = objCountFile.ReadAll  
 objCountFile.Close  
 FiletempData=Replace(FiletempData,Target,repString)  
 Set objCountFile=objFSO.CreateTextFile(Server.MapPath(fileName),True)  
 objCountFile.Write FiletempData  
 objCountFile.Close  
 Set objCountFile=Nothing  
 Set objFSO = Nothing  
End Function