网络编程
位置:首页>> 网络编程>> Asp编程>> asp如何做一个专门显示文本文件的页面?

asp如何做一个专门显示文本文件的页面?

  发布时间:2010-07-12 19:04:00 

标签:文本,asp

如何做一个专门显示文本文件的页面?

    代码如下:
txt.asp

<html>
<head>
<title><%fn=request.querystring("fn") pointposition=instrrev(fn,".") hn=left(fn,pointposition-1) %></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
BODY{font-size: 9pt ;}
td {font-size: 9pt ;}
P  {font-size: 9pt ;}
font {font-size: 9pt ;}
A:link {color:teal; font-style: normal; text-decoration: none; cursor: hand}
A:visited {color: teal; font-style: normal; text-decoration: none}
A:active {color: rgb(155,55,0); font-style: normal; text-decoration: none}
A:hover {color: red; font-style:bold; text-decoration:underline}  
TABLE {font-family:宋体;font-size:9pt;color:#000000}
INPUT {font-family:宋体;font-size:9pt;color:#000000}
TEXTAREA {font-family:宋体;font-size:9pt;color:#000000}
-->
</style>
</head>
<body bgcolor="#EBA9DB">
<table width="100%" border="0" align="center">
  <tr>
    <td width="100%" height="105" valign="top"><dl>
    <dd align="center"><br>
    <div align="center"><center><table border="0" cellspacing="0" width="600" height="152">
    <tr>
    <td height="59"><p align="center">精彩春风之TXT文本显示 </font></td>
    <td height="14"></td>
    </tr>
    <tr>
<td width="642" height="1" bgcolor="#FFFFFF">
<table width="100%" border="0" align="center" bgcolor="#D0F7E7" height="92">
    <tr>
<td width="90%" height="88">
<%
fn="/intels/chunfeng/txt/"&fn
Set fs = Server.CreateObject("Scripting.FileSystemObject")
set thefile=fs.opentextfile(server.mappath(fn),1,false)
nr=thefile.readall
%>
<pre><%=nr%></pre>
<p>
<%
thefile.close
%> 
</td>
</tr>
</table>
</td>
</tr>
    <tr>
    <td height="14"></td>
    </tr>
    /table>
    </center></div></dd>
    <div align="center"><center><table border="0" cellpadding="0" cellspacing="3" width="689">
    <tr>
    <td width="355"></td>
    <td nowrap width="18"><span style="font-size: 10pt"><a href="javascript:history.back()">
<img  border="0" hspace="3" width="11" height="11"></a></span></td>
    <td nowrap width="65"><a href="javascript:window.history.back()"
    style="COLOR: rgb(128,128,128)"><font color="#000000"><span style="font-size: 10pt">返回上一页</span></font></a></td>
    <td nowrap valign="top" width="15"><a href="javascript:window.scroll(0,0)"><span
style="font-size: 10pt"><img border="0" hspace="3" width="11" height="11">
</span></a></td>
    <td nowrap width="99"><font color="#000000"><span style="font-size: 10pt">返回首页</span></font></td>
    </tr>
    </table>
    </center></div>
    </dl>
    </td>
    </tr>
</table>
</body>
</html>
<noscript>

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com