繁体中文
设为首页
加入收藏
当前位置:.Net技术首页 >> Asp.Net开发 >> 一个asp+ 版本的 Active Server Explorer

一个asp+ 版本的 Active Server Explorer

2007-03-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介:/* 豆腐制作 都是精品 http://www.ASP888.net 豆腐技术站 如转载 请保留版权信息 */ 很多人可能都用过 chinaASP 出的 ase 可以对 服务器上的文件进行各种操作,在这里我们也来 讲一个在 ASP plus 下实现 ase 的程...

/*

豆腐制作 都是精品

http://www.ASP888.net 豆腐技术站

如转载 请保留版权信息

*/

很多人可能都用过 chinaASP 出的 ase 可以对 服务器上的文件进行各种操作,在这里我们也来

讲一个在 ASP plus 下实现 ase 的程序 由于时间仓促 和本来就是 出于 演示的目的 本程序只演示了最简单的 情况 至于 上传 和编辑文本文件 我在 以前的文章里 都已经 讲过了,大家可以到 http://www.ASP888.net 查看技术栏目里面的文章

首先是 列出 机器上 的盘符

<%

string[] LocalDriver = Directory.GetLogicalDrives();

int intNum = LocalDriver.Length;

Response.Write("");

for (int i=0; i

ASPx?dir=">

<%

}

Response.Write("");

%>

列出所选择的盘符 上的目录

<%

string strDir2List = Server.UrlDecode(Request.QueryString.Get("dir"));

Directory thisOne = null;

try

{

thisOne = new Directory(strDir2List);

// 得到当前的目录创建时间

Response.Write("

当前所在目录: " + thisOne.ToString() + "");

Directory[] Dir = thisOne.GetDirectories();

Response.Write("");

for (int i=0; i < Dir.Length; i++)

{

Response.Write("ASPx?dir=");

Response.Write(Server.UrlEncode(Dir[i].FullName));

Response.Write("\">" + Dir[i].Name);

Response.Write("

");

}

Response.Write("");

File[] Files = thisOne.GetFiles();

Response.Write("");

for (int i=0; i < Files.Length; i++)

{

Response.Write("ASPx?file=");

Response.Write(Server.UrlEncode(Files[i].FullName));

Response.Write("\">" + Files[i].Name);

Response.Write("

");

}

Response.Write("");

}

catch (Exception e)

{

Response.Write("错误: ");

Response.Write(e.ToString() + "");

Response.End();

}

%>

查看文件的详细信息:

编辑文件

文件名称:

文件的全名:

所在目录:

文件创建时间:

文件大小: Bytes

最近一次的存取时间:

最近一次更新时间:

<%

ss=split(thisOne.Name,".")

fileent=lcase(ss(ubound(ss)))

if fileent="txt" or fileent="ASP" or fileent="ASPx" then

theReader = thisOne.OpenText()

Do

strIn = theReader.ReadLine()

response.write(strIn)

Loop Until strIn = Null

%>

好了一个完整的 ase 程序还需要 删除 拷贝 移动和上传 编辑 相信大家在 看完这个程序以后 一定会 有办法 经过 简单 的改动 就 可以实现

这个程序的完整例子可以在 http://www.ASP888.net/download/ASP/ase.zip 下载

谢谢大家

作者:豆腐()

责任编辑:admin
相关文章