《拓文asp.net网站内容管理系统》官方演示站。
 设为首页  
 收藏本站
 作者:黄振安
 QQ:53854651
首 页 开源拓文.NET编程网站编程网页设计图形图像数据库软件工程留言本
    站内搜索:  
您现在的位置: 拓文网络 → .NET编程 → ASP.NET → 查看服务器磁盘、文件的aspx[正文]

热 门 文 章

相 关 文 章
没有相关文章!
查看服务器磁盘、文件的aspx
 
[作者:不详    转贴自:不详    点击数:    更新时间:2006-2-25 15:17:39]


showfile.aspx


<% @Page Language="C#" Debug="true"%>
<% @Import Namespace="System.IO" %>
<html>
<head><title>File Info</title></head>
<body>
<%
string strFile2Show = Request.QueryString.Get("file");
File thisOne = new File(strFile2Show);
%>
<table>
<tr><td>文件名:</td><td><%=thisOne.Name%></td></tr>
<tr><td>
全名:</td><td><%=thisOne.FullName%></td></tr>
<tr><td>
文件创建日期:</td><td><%=thisOne.CreationTime.ToString()%></td></tr>
<tr><td>
文件大小:</td><td><%=thisOne.Length.ToString()%> Bytes</td></tr>
<tr><td>
上次使用时间:</td><td><%=thisOne.LastAccessTime.ToString()%></td></tr>
<tr><td>
上次修改时间:</td><td><%=thisOne.LastWriteTime.ToString()%></td></tr>
</table>

<%
StreamReader theReader = thisOne.OpenText();
char[] theBuffer = new char[1000];
int nRead = theReader.ReadBlock(theBuffer, 0, 1000);
Response.Write("<br>");
Response.Write("
文件内容预览:");
Response.Write("<br>");
Response.Write("<pre>");
Response.Write(Server.HtmlEncode(new String(theBuffer,0,nRead)));
Response.Write("</pre>");
%>

</body>
</html>


首页 | 1 | 2 | 尾页  共 2 页
 
winner 打印本页 关闭窗口

     文 章 评 论
评论人 查看该文章的评论 发表时间
   笔 名* : 0 50分 60分 70分 80分 90分 100分
评论内容 *: (最多1000字。当前字数:0)


没有相关评论,欢迎您参与!

- 关于本站 - 网站帮助 - 下载声明 - 友情连接 - 网站地图 -
Copyright © 2005-2006 myTopWin.Com. All Rights Reserved . [桂ICP备06004496号]