一个asp+ 版本的 Active Server Explorer

2016-01-29 14:01 1 1 收藏

一个asp+ 版本的 Active Server Explorer,一个asp+ 版本的 Active Server Explorer

【 tulaoshi.com - ASP.NET 】

/*
豆腐制作 都是精品
http://www.asp888.net 豆腐技术站
如转载 请保留版权信息
*/
很多人可能都用过 chinaAsp 出的 ase 可以对 服务器上的文件进行各种操作,在这里我们也来
讲一个在 asp plus 下实现 ase 的程序 由于时间仓促 和本来就是 出于 演示的目的 本程序只演示了最简单的 情况 至于 上传 和编辑文本文件 我在 以前的文章里 都已经 讲过了,大家可以到 http://www.asp888.net 查看技术栏目里面的文章
首先是 列出 机器上 的盘符
<% @Page Language="C#" %
<% @Import Namespace="System.IO" %
<%
string[] LocalDriver = Directory.GetLogicalDrives();
int intNum = LocalDriver.Length;
Response.Write("<ul");
for (int i=0; i < intNum; i++)
{
%
<li<a href="dir.aspx?dir=<%=Server.UrlEncode(LocalDriver[i])%"<%=LocalDriver[i]%</a</li
<%
}
Response.Write("</ul");
%
列出所选择的盘符 上的目录
<% @Page Language="C#" %
<% @Import Namespace="System.IO" %
<%
string strDir2List = Server.UrlDecode(Request.QueryString.Get("dir"));
Directory thisOne = null;
try
{
thisOne = new Directory(strDir2List);
// 得到当前的目录创建时间
Response.Write("<p当前所在目录: " + thisOne.ToString() + "</p");
Directory[] Dir = thisOne.GetDirectories();
Response.Write("<ul");
for (int i=0; i < Dir.Length; i++)
{
Response.Write("<li<a href="dir.aspx?dir=");
Response.Write(Server.UrlEncode(Dir[i].FullName));
Response.Write(""" + Dir[i].Name);
Response.Write("</a<br");
}
Response.Write("</ul");

File[] Files = thisOne.GetFiles();
Response.Write("<ul");
for (int i=0; i < Files.Length; i++)
{
Response.Write("<li<a href="viewfile.aspx?file=");
Response.Write(Server.UrlEncode(Files[i].FullName));
Response.Write(""" + Files[i].Name);
Response.Write("</a<br");
}
Response.Write("</ul");
}
catch (Exception e)
{
Response.Write("错误: <i");
Response.Write(e.ToString() + "</i");
Response.End();
}
%
查看文件的详细信息:
<% @Page Language=VB %
<% @Import Namespace="System" %
<% @Import Namespace="System.IO" %
<html
<head<title编辑文件</title</head
<body
<%
dim File as string
File = Request.QueryString.Get("file")
thisOne = new File(File)
'string File = Request.QueryString.Get("file");
'File thisOne = new File(File);
%
<table
<tr<td文件名称:</td<td<%=thisOne.Name%</td</tr
<tr<td文件的全名:</td<td<%=thisOne.FullName%</td</tr
<tr<td所在目录:</td<td<%=thisOne.DirectoryName%</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
<%
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

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com)

%
<form action="savefile.asp" method=post
<textarea cols=40 rows=30<%=strIn%</textarea
<input type=hidden name=filename value="<%=thisOne.FullName%"
<br
<input type=submit value="保存更改"
</form

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com)

<%
end if
%
</body
</html
好了一个完整的 ase 程序还需要 删除 拷贝 移动和

来源:https://www.tulaoshi.com/n/20160129/1492284.html

延伸阅读
标签: ASP
  Config.web 配置文件 所有ASP+的配置信息都包括在名叫Config.web的配置文件当中。下面的例子说明了一个ASP+配置文件的结构: 代码: -------------------------------------------------------------------------------- <!-- CONFIG.WEB FILE --<configuration   <configsections    &n...
标签: ASP
  ASP+ 中文教程-----asp+简介、安装、以及如何显示中文     终于空下一段时间,可以学一些新东西,看了一下有关asp+的相关资料,觉得很值得学一下,所以就一边学习一边写下这个教程,对于自己来说,可以作为学习笔记,对于别人,尤其是那些E文不太好的朋友可以作为一个可看的中文资料吧,起个抛砖引玉的作用。由于...
标签: ASP
  ASP+ 现在支持两种语言C# (简称 "C Sharp"), Visual Basic, and JScript. 基于习惯,在以下的语言介绍中,我们采用的练习和例程采用VB和C#语言来开发Web应用程序.如果想要得到关于.Net技术的详细资料,请去MS的站点 查看关于 NGWS SDK! 在下面的列表中,你可以看到关于这两种语言的语法的简要介绍 1.变量声名 C# 语法 in...
Anthony Moore Microsoft Corporation 2000年10月 摘要:有关使用 ASP+ 验证 Web 控件的详细讲解 简介 这篇文章详细讲解了 ASP+ 验证控件的工作方式。如果要生成其中包含验证控件的复杂页面,或是要扩展验证框架,建议您阅读本文。如果要学习使用验证控件,或是要决定是否使用验证控件,请参见“ASP+ 中的用户输入验证(英文)”。 入门 ...
标签: ASP
  层次配置体系 我们曾论及,服务器上可以有多个配置文件存在于不同的目录中。当对一个详细URL的请求到达时,ASP+计算该URL在层 次结构风格中的设定,并为所请求的URL使用在路径中定位的配置文件。 例如,一个站点的结构如下: Application Root |-----SubDir1 |-----SubDir2 想法是,配置应用程序的设定使所有的用户都可以...

经验教程

72

收藏

30
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部