asp读写删除文件

时间:2009-02-22    点击:1515   

asp写文件:

<%
create_file "write","111.htm"

%>

<%
sub create_file(T_content,T_path)
   on error resume next
   Set fso = Server.CreateObject("Scripting.FileSystemObject") 
   Set fout = fso.CreateTextFile(Server.MapPath(T_path))
   fout.WriteLine T_content
   fout.close  
   set fout=nothing
 
   set fso=nothing  
end sub

%>

asp读取文件:

<%

function read_file(filename)

set fso = server.createobject("scripting.filesystemobject")
set objcountfile = fso.opentextfile(server.mappath(filename),1,true)
read_file = objcountfile.readall
objcountfile.close
set objcountfile=nothing
set fso = nothing

end function


%>

 

利用ADODB.Stream读取文件内容


<%
Dim EditFile
EditFile = "111.htm"
Set objStream = CreateObject("adodb.stream")
objStream.Open
objStream.Type = 2
objStream.Charset = "utf-8" '字符形式,不定义否则出现乱码现象
objStream.LoadFromFile(Server.MapPath(EditFile))
strAllContent = objStream.ReadText
objStream.Close
Set objStream = Nothing
Response.Write(strAllContent)
%>


asp删除文件

<%
 set fs=server.CreateObject("scripting.filesystemobject")
   path=server.MapPath(filename)
   if fs.FileExists(path) then
      fs.DeleteFile path,true
   end if
%>

很酷的图片显示效果
图片渐隐渐显
FLASH图片切换3
判断图片是否存在
给图片加个放大镜
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 All Rights Reserved