国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

一個免費的郵件列表源程序(二)

2019-11-18 22:27:29
字體:
來源:轉載
供稿:網友
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.
      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%">' );
}
%>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 扶风县| 定日县| 阿拉善右旗| 湖口县| 郁南县| 伊川县| 牡丹江市| 巫溪县| 封丘县| 葫芦岛市| 屏山县| 海淀区| 博客| 酉阳| 上虞市| 延庆县| 南川市| 姜堰市| 秦安县| 监利县| 陵水| 南皮县| 区。| 抚顺市| 濮阳市| 红安县| 康定县| 湘乡市| 诸城市| 马尔康县| 锡林郭勒盟| 灌南县| 绥化市| 凌海市| 分宜县| 永仁县| 建德市| 鸡泽县| 封开县| 深水埗区| 濮阳市|