网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
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,移动开发
本月文章推荐
.完整的访问统计程序(二 程序篇).
.制作我们自己的Ebay(拍卖系统)(7).
.ASP进阶之文章在线管理更新(9).
.一个新版本的ubb转化程序.
.编写“公平”的ASP图形计数器.
.用ASP做一个记事本编缉器(附源码.
.ASP 编程中20个非常有用的例子.
.一个漂亮的点击计数器.
.第一个ASP组件:设置服务器日期时.
.动态广告管理程序制作例子.
.用ASP开发一个在线考试程序(一).
.一个功能完善的专栏管理的程序-&.
.最简单的ASP聊天室(附源码).
.用ASP实现论坛的UBB功能(二).
.用asp怎样编写文档搜索页面(2).
.金额大小写转换的asp完全无错版本.
.ASP进阶之文章在线管理更新(3).
.jmail4.1用pop3收信的例子.
.在ASP中使用Oracle数据库.
.ASP中实现文件上传方法的研究.

一个免费的邮件列表源程序(二)

发表日期:2000-8-18


ShowSource.asp
<%@ Language=JavaScript %>

<!--#include file = "include/SetGlobals.asp"-->

<%
// get the page to display from the URL
var sPage = "" + Request.QueryString ( "page" );

// make sure it's a page we allow them to view!
switch ( sPage )
{
case "Wider":
case "COM":
case "Handle404":
case "Categories":
case "CategoryPage":
case "Columns":
case "ResultsPage":
case "Date":
case "Contact":
case "Subscribe":
case "MailToList":
   break;

default:
   Response.Redirect ( "NaughtyNaughty!" );
}

// output relevant meta tags
Init( "ASP source example" );

// output common top of page
Header( '<a href="work.asp">Work</a> --> <a href="' + sPage + '.asp">"' + sPage + '.asp"</a> --> Source', 3 );

// output page content
Content ( );

// output common bottom of page
Footer ( );
%>

<% /* standard page elements */ %>
<!--#include file = "utils/Init.asp"-->
<!--#include file = "utils/Header.asp"-->
<!--#include file = "utils/Footer.asp"-->
<!--#include file = "utils/ShowFile.asp"-->

<%
// ============================================
// the content of this page
// ============================================
function Content ( )
{
   Out ( '<td width="20%">&nbsp;</td>' );
   Out ( '<td width="60%">' );

      // create handle to FileSystemObject
      var oFSO = Server.CreateObject ( 'Scripting.FileSystemObject' );

      // each source file that we show source for could have a related
      // documentation file for us to display before and after the
      // source. for now, I use a generic header and footer file. the
      // 'true' tells ShowFile to pass through any HTML to the browser.

      ShowFile ( oFSO, 'Generic.pre', true, false );

      switch ( sPage )
      {
      case "Categories":
      case "CategoryPage":
      case "Columns":
         Out ( '<p><img src="images/new.gif">&nbsp;<a href="Categories.zip">Download</a> all the source for the category demonstration!<p>' );
         break;
      }

      ShowSource ( oFSO, sPage + '.asp', true );

      // show any extra utility file(s) too
      switch ( sPage )
      {
      case "Wider":
         ShowSource ( oFSO, 'include/SetGlobals.asp', true );
         ShowSource ( oFSO, 'utils/Header.asp', true );
         break;

      case "Categories":
      case "CategoryPage":
      case "Columns":
      case "Subscribe":
      case "MailToList":
         ShowSource ( oFSO, 'utils/Database.asp', true );
         break;

      case "Categories":
      case "CategoryPage":
      case "Columns":
         ShowSource ( oFSO, 'utils/ShowCategory.asp', true );
         break;
      }

      // show the generic footer
      ShowFile ( oFSO, 'Generic.pst', true, false );

      // we've finished with the object so free the resource
      oFSO = null;

      Out ( '<p><center><a href="FSO.asp"><img src="images/source.gif" border=0></a></center>' );

   Out ( '</td>' );
   Out ( '<td width="20%">&nbsp;</td>' );
}
%>
     
utils/ShowFile.asp
<%
// have we advertized our mailing list yet?
var bDoneLink = false;

// ============================================
// display the contents of the given file
// ============================================
function ShowFile ( oFSO, sFile, bPassHTML, bShowName )
{
   var ForReading = 1;
   // var ForWriting = 2;
   // var ForAppending = 8;

   // open asp file for reading
   var fFile = oFSO.OpenTextFile ( Server.MapPath( sFile ), ForReading );

   // read entire file contents into variable
   var s = fFile.ReadAll ( );

   if ( !bPassHTML )
   {
      // replace & with &amp; so HTML displayed, not interpreted
      s = s.replace ( /&/g, '&amp;' );

      // replace < with &lt; so HTML displayed, not interpreted
      s = s.replace ( /</g, '&lt;' );

      // replace newline with HTML equivalent
      s = s.replace ( /\n/g, '<br>' );

      // replace tabs with 3 spaces
      s = s.replace ( /\t/g, '&nbsp;&nbsp;&nbsp;' );

      // show filename and change font color for source code
      s = '<font color="black">' + s + '</font>';

      if ( bShowName )
         s = '<h4>' + sFile + '</h4>' + s;
   }

   Out ( s );

   fFile.Close ( );
}

// ============================================
// show a source file outside the table
// ============================================
function ShowSource ( oFSO, sFile, bShowName )
{
   // advertize our mailing list before the first source file
   if ( !bDoneLink )
   {
      bDoneLink = true;
      Out ( '<p><b>Get informed when the source code below changes!</b> <a href="subscribe.asp">Subscribe to our mailing list.</a>' );
   }

   Out ( '</td>' );
   Out ( '<td width="20%">&nbsp;</td></tr><tr><td colspan=3 width="100%" bgcolor="#ff9900">' );

      // show news file
      ShowFile ( oFSO, sFile, false, bShowName );

   Out ( '</td></tr><tr><td width="20%">&nbsp;</td>' );
   Out ( '<td width="60%">' );
}
%>
上一篇:一个免费的邮件列表源程序(一) 人气:12566
下一篇:一个免费的邮件列表源程序(三) 人气:11744
浏览全部邮件列表源程序的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐