ASP Move ·½·¨

¶¨ÒåºÍÓ÷¨

Move ·½·¨°ÑÖ¸¶¨µÄÎļþ»òÎļþ´ÓÒ»¸öλÖÃÒÆ¶¯µ½ÁíÍâÒ»¸öλÖá£

×¢ÊÍ£º¶Ô File »ò Folder Ó¦Óà Move ·½·¨µÄ½á¹ûÓëʹÓà FileSystemObject.MoveFile »ò FileSystemObject.MoveFolder Ö´ÐеIJÙ×÷ÍêÈ«Ïàͬ¡£È»¶ø£¬Òª×¢ÒâµÄÊÇ FileSystemObject.MoveFile »ò FileSystemObject.MoveFolder ·½·¨¿ÉÒÆ¶¯¶à¸öÎļþ»òÎļþ¼Ð¡£

Óï·¨£º

FileObject.Move(destination)
FolderObject.Move(destination)
²ÎÊý ÃèÊö
destination ±ØÐèµÄ¡£Òƶ¯Îļþ»òÎļþ¼ÐµÄÄ¿µÄµØ¡£ÔÊÐíʹÓÃͨÅä·û¡£

Õë¶Ô File ¶ÔÏóµÄÀý×Ó

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.GetFile("c:\test.txt")
f.Move("c:\test\test.txt")
set f=nothing
set fs=nothing
%>

Õë¶Ô Folder ¶ÔÏóµÄÀý×Ó

<%
dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test")
fo.Move("c:\asp\test")
set fo=nothing
set fs=nothing
%>
VUE