|
ASP
File
More detial or script code example
to delete an exist file (can be .txt
.asp .php .jpg .pl ...any file)
刪除一已經確認存在的檔案 Description: To delete a file " a.txt "
Set fso=Server.CreateObject("Scripting.FileSystemObject")
often be used
Path : identify the root on server
FileExists : to make sure the file is exist ,
or it will not working fine
Set fso=Server.CreateObject("Scripting.FileSystemObject")
常被使用在檔案與資料夾的呼叫
Path : 可幫助束記資料主機路逕
FileExists : 確認是否存在後才執行是不可缺保障檢查,免得出現錯誤訊息
ASP
File
More detial or script code example
File.Move
檔案 移動 Description: To move a file from one place two another place
將檔案轉移到別的檔案夾 
ASP
File
More detial or script code example
check how many files in a folder
計算出在某特定的資料夾中有多少檔案 Description: to count how many files in a folder
經常與建立檔案時檢查檔案數目使用 
ASP
File
More detial or script code example
read and print server side file code
自己由瀏覽器讀取自己伺服端的檔案原始碼 Description: Set fso = Server.CreateObject ("Scripting.FileSystemObject")
or
Set fso = CreateObject ("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile(thePath)
.Readline
.Readall

ASP
File
More detial or script code example
FileSystemObject.CreateTextFile(filename[,overwrite[,unicode]])
to create a new file (eg .txt .asp .php .jpg .pl ...any file)
建立一個新的檔案 Description: FileSystemObject.CreateTextFile(filename[,overwrite[,unicode]])
true: allow overwrite
false: disallow overwrite
可先設定
Const toRead = 1
Const toWrit = 2
Const toAppend = 8
結果
set file = fso.OpenTextFile(path, toReading)
與
set file = fso.OpenTextFile(path, 2)
相同 
ASP
File
More detial or script code example
Server.MapPath(Request.ServerVariables("PATH_INFO"))
Server.MapPath(Path) 網址虛擬根目錄或Path 指定映射物理目錄的相對 Description: for Each objFile in objFolder.Files
whereimages=Server.MapPath("\image_folder\")
read each file in objFSO.GetFolder(whereimages)
same as
Request.ServerVariables("APPL_PHYSICAL_PATH")&"image_file"

|