|
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

ASP
File
More detial or script code example
Server.MapPath(Request.ServerVariables("PATH_INFO"))
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"

ASP
file
More detial or script code example
Creating and Naming a Text File
Description: 1.
Create an instance of the FileSystemObject.
2.
Set a variable named strPath to the folder where the file will be created (C:\FSO).
3.
Use the GetTempName method to generate a unique file name.
4.
Use the BuildPath method to combine the folder name and file name and create a full path for the temporary file. The full path is stored in the variable strFullName.
5.
Call the CreateTextFile method, using strFullName as the method parameter.
6.
Close the file immediately after creating it. In a production environment, you would most likely write data to the file before closing it.

|