网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > ASP实例
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.使用InstallShield制作ASP安装程.
.数组数据排序的程序例子.
.如何制作无状态的ASP组件.
.利用ASP实现三个强大功能之一.
.ASPImage组件的实现过程.
.用SQL Server为Web浏览器提供图像.
.asp实现k线图(在线).
.一个功能完善的专栏管理的程序-&.
.用纯ASP代码实现图片上传.
.用户注册及跟踪代码(一).
.一个BBS的源代码(一).
.不用图像组件的ASP图像计数器.
.利用ASP制作EXECL报表方法(二).
.使用纯粹的asp+语言制作的栏目管.
.无组件上传图片至SQLSERVER数据库.
.一个的无组件上传的ASP代码.
.浅谈TeeChart组件在ASP中的应用.
.XMLHTTP+Javascript+Asp写得聊天.
.ASP后台快速调用Mysql 数据库.
.使用JScript.NET创建asp.net页面.

简单的文件目录浏览源程序

发表日期:2000-8-24



    '**************************************
    ' Name: File / Directory Viewer
    ' Description:This Will Display All The
    '     Files, File Size and file date of every
    '     file in the directory you specify.
    To make this work, paste the code into your favorite html editor, save it and Then view it.
    ' By: Thomas Michael
    '
    '
    ' Inputs:None
    '
    ' Returns:None
    '
    'Assumes:File System Object Be Needed :)
    '     and it is setup to look for you my docum
    '     ents folder at "c:\mydocu~1" but you can
    '     change the line of code to look in any d
    '     irectory.
    '
    'Side Effects:None
    '
    'Warranty:
    'code provided by Planet Source Code(tm)
    '     (http://www.Planet-Source-Code.com) 'as
    '     is', without warranties as to performanc
    '     e, fitness, merchantability,and any othe
    '     r warranty (whether expressed or implied
    '     ).
    'Terms of Agreement:
    'By using this source code, you agree to
    '     the following terms...
    ' 1) You may use this source code in per
    '     sonal projects and may compile it into a
    '     n .exe/.dll/.ocx and distribute it in bi
    '     nary format freely and with no charge.
    ' 2) You MAY NOT redistribute this sourc
    '     e code (for example to a web site) witho
    '     ut written permission from the original
    '     author.Failure to do so is a violation o
    '     f copyright laws.
    ' 3) You may link to this code from anot
    '     her website, provided it is not wrapped
    '     in a frame.
    ' 4) The author of this code may have re
    '     tained certain additional copyright righ
    '     ts.If so, this is indicated in the autho
    '     r's description.
    '**************************************
    
    <%@ LANGUAGE="VBSCRIPT" %>
    <% Option Explicit %>
    <HTML>
    <HEAD> <TITLE>File Viewer</TITLE> </HEAD>
    <BODY>
    <TABLE width="100%" border=1 bordercolor="#000000" align="left" cellpadding="2" cellspacing="0">
    <TR align="left" valign="top" bgcolor="#000000">
     <TD width="65%"><FONT color="#FFFFFF"><B><FONT size="2" face="Verdana, Arial, Helvetica, sans-
serif">Title</FONT></B></FONT></TD>
    <TD width="10%"><FONT color="#FFFFFF"><B><FONT size="2" face="Verdana, Arial, Helvetica, sans-
serif">Size</FONT></B></FONT></TD>
    <TD width="25%"><FONT color="#FFFFFF"><B><FONT size="2" face="Verdana, Arial, Helvetica, sans-
serif">Date</FONT></B></FONT></TD>
    </TR>
    <%
     'File System Object
     Dim objFSO
     'File Object
     Dim objFile
     'Folder Object
     Dim objFolder
     'String To Store The Real Path
     Dim sMapPath
     'Create File System Object To Get list of files
     Set objFSO = CreateObject("Scripting.FileSystemObject")
     'Get The path For the web page and its dir.
     'change this setting To view different directories
     sMapPath = "C:\Mydocu~1"
     'Set the object folder To the mapped path
     Set objFolder = objFSO.GetFolder(sMapPath)
     'For Each file In the folder
     For Each objFile In objFolder.Files
     %>
     <TR align="left" valign="top" bordercolor="#999999" bgcolor="#FFFFFF">
     <TD> <FONT size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#000000"><A href="<% =
sMapPath & "/" & objFile.Name %>">
     <%
     'write the files name
     Response.Write objFile.Name
     %>
     </A>
     </FONT>
     </TD>
    <TD>
     <FONT size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#000000">
    
     <%
     'We will format the file size so it looks pretty
     If objFile.Size <1024 Then
     Response.Write objFile.Size & " Bytes"
     ElseIf objFile.Size < 1048576 Then
     Response.Write Round(objFile.Size / 1024.1) & " KB"
     Else
     Response.Write Round((objFile.Size/1024)/1024.1) & " MB"
     End If
     %>
     </FONT>
     </TD>
    <TD>
     <FONT size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#000000">
     <% 'the files Date
     Response.Write objFile.DateLastModified
     %>
     </FONT>
     </TD>
     </FONT>
     </TD>
     </TR>
     <%
     Next
     %>
    </TABLE>
    </BODY>
    </HTML>




上一篇:用密码保护页面 (III) 人气:15466
下一篇:使用VB编写纯ASP程序 人气:11359
浏览全部文件目录浏览源程序的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐