📄 showfile_1.asp
字号:
<%
'************************************************************************************************
' 文件名: showfile.asp
' Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
' 创建人 : 周秋舫
' 日 期 : 2002-08-16
' 修改历史 :
' ****年**月**日 ****** 修改内容:**************************************************
' 功能描述 : 显示文件内容,文件内容信息是从数据库获取的
' 版 本 :
'************************************************************************************************
option explicit
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
%>
<!-- #include file="../include/config.inc" -->
<!-- #include file="../include/common.inc" -->
<!-- #include file="../include/debug.inc" -->
<!-- #include file="../include/db.inc" -->
<!-- #include file="../include/date.inc" -->
<!-- #include file="../include/datahandle.inc" -->
<!-- #include file="../include/recordlist.inc" -->
<!-- #include file="../include/security.inc" -->
<%
dim pFileSerial : pFileSerial = GetParam("serial")
if IsEmpty(pFileSerial) then pFileSerial = 1
'iEmpSerial = GetEmpSerial
dim iEmpSerial
dim fso, myfile, i
if CStr(iEmpSerial) = "" then iEmpSerial = 201
dim crs, rs
set crs = New CRecordset
set rs = crs.Open(dbLocal, "select filename, contenttype, content from t_files where serial=" & pFileSerial)
if not rs.eof then
dim content, filename
content = rs("content")
filename = rs("filename")
'Response.ContentType = crs.GetValue("contentType")
' set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")
set fso = server.createobject("Scripting.FileSystemObject")
dim filepath : filepath = left(Request.ServerVariables("PATH_TRANSLATED"), instrrev(Request.ServerVariables("PATH_TRANSLATED"),"\")) & "temp\" & iEmpSerial & "_" & filename
' response.write filepath : response.end
set MyFile = fso.CreateTextFile(filepath, True)
' set myfile = fso.CreateTextFile("c:\testfile.txt", True)
' set MyFile = fso.CreateTextFile("c:\testfile.txt", True)
For i = 1 to LenB(content)
if AscB(MidB(content,i,1)) > 127 then
myfile.Write chr(AscB(MidB(content,i,1))*256+AscB(MidB(content, i+1, i)))
i = i + 1
else
myfile.Write chr(AscB(MidB(content,i,1)))
end if
Next
myfile.close
' Response.Write "<html>" & vbLF
' Response.Write "<head>" & vbLF
' Response.Write "<title>" & crs.GetValue("filename") & "</title>" & vbLF
' Response.Write "<meta http-equiv=""Content-Type"" content=""" & crs.GetValue("contenttype") & "; charset=gb2312"">" & vbLF
' Response.Write "</head>" & vbLF
' Response.Write "<body>" & vbLF
' Response.BinaryWrite crs.GetValue("content")
' Response.Write "</body>" & vbLF
' Response.Write "</html>" & vbLF
crs.Close()
else
Response.Write "<script language=""javascript"">window.close();</script>"
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -