优秀的软件开发团队:深圳升蓝软件 数据库开发 .Net技术  |  ASP技术 PHP技术 JSP技术 应用技术类     
热门推荐
升蓝OA办公自动化系统
基于.Net技术的网络
协同办公环境
 
ASP基础
数据库相关
安全加密
全文检索
ASP应用
打印相关
客户端相关
XML相关
系统相关
正则表达式
ASP技巧
组件开发
脚本编码
FSO专题
邮件相关
远程脚本
性能优化
 
相关链接
深圳升蓝软件:系统集成、办公自动化平台、电子商务、电子政务、Web数据库、企业网站、游戏、手机应用程序、CDMA软件、电子出版物等,为客户提供优秀的解决方案
 
升蓝(www.hi-blue.com)为企业管理、政府办公提供成熟的、易于实施的IT技术服务,我们的解决方案包括OA办公自动化系统CRM客户关系管理系统ERP企业生产管理和订单管理系统电子政务系统、知识管理系统、企业门户、商业智能、工程项目管理等等...
 
电子政务解决方案
塑料/橡胶管理系统
知识管理系统简介
多媒体光盘方案
ERP企业资源管理
订单计划管理系统
PM工程项目管理系统
会员管理系统
相关资料下载
OA办公自动化系统
CRM客户关系管理系统
在线试用版本说明
OA 系统的用户手册
 
 
 
 
升蓝开发团队 > 技术资料 > ASP技术 > 打印相关 : 使用<meta>标签的ASP源程序例子

使用<meta>标签的ASP源程序例子


March 25,2004
utils/Init.asp
<%
// ============================================
// NOTE: all source code downloaded from CoverYourASP was written by
// James Shaw (unless stated otherwise), and is copyright (c) 2000 by
// James Shaw. You may use this source code on your web sites, but
// please don't publish or distribute in any way.
//
// I would appreciate an HTML comment in any code you use, i.e.
//         <!-- portions (c) james@CoverYourASP.com-->
// (see Footer(), documented in SSI.asp for details on how to do this)
//
// <shameless plug>
//      Please contact me to discuss any ASP contract work you may have.
// </shameless plug>
// ============================================

// ============================================
// the standard meta tags to start document
// ============================================
function Init ( sTitle, sKeywords )
{
   Out ( '<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-
html40/loose.dtd">' );
   Out ( '<html><head>' );
   Out ( '<base target="_top">' );

   // for any browsers
   Out ( '<link rev=MADE href="mailto:james@CoverYourASP.com">' );
   Out ( '<meta name="resource-type" content="document">' );
   Out ( '<meta http-equiv="Content-Type" Content="text-html; charset=iso8859-1">' );
   Out ( '<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen
true comment "RSACi North America Server" for "http://CoverYourASP.com/" on "2000.09.08T03:03-0800" r (n 0
s 0 v 0 l 0))'>' );

   // for spiders only - I hide these lines from browsers
   var sBrowser = "" + Request.ServerVariables ( 'HTTP_USER_AGENT' );

   if ( ( -1 == sBrowser.indexOf ( 'Mozilla' ) && -1 == sBrowser.indexOf ( 'Opera' ) ) || IsDebug () )
   {
      // it's an unknown browser - probably a spider
      Out ( '<meta name="Author" content="James Shaw">' );
      Out ( '<meta name="Keywords" content="coveryourasp, cya, james shaw, asp, active server pages,
active, server, pages, scripts, microsoft, iis, email, cdonts, form, access, database, free code, source,
code, programmer, programming, developer, development, javascript, jscript, com, atl, c++' );
      // add any passed-in keywords
      if ( sKeywords != undefined )
         Out ( ', ' + sKeywords );
      Out ( '"><meta name="Description" content="Live examples and full source code for solving practical
problems using ASP (Active Server Pages), C++ ATL COM components, Server and Client-side JavaScript and
DHTML.">' );
   }
   else
   {
      // it's a known browser - show "throwaway" keywords so we don't arouse suspicion!
      Out ( '<meta name="Keywords" content="James Shaw">' );
      Out ( '<meta name="Description" content="James Shaw's site">' );
   }

   Out ( '<title>' + sTitle + '</title>' );

   Out ( '<style>' );
      Out ( 'a:link { color:#FF3300; }' );
      Out ( 'a:vlink { color:#FF3300; }' );
      Out ( 'a:alink { color:#CC0000; }' );
      Out ( 'body { font:8pt/11pt verdana;}' );
      Out ( 'table { font:8pt/11pt verdana;}' );
   Out ( '</style></head>' );
}

// ============================================
// are we being run from a special debug URL?
// ============================================
var bDebug;

function IsDebug ( )
{
   // for efficiency, only work out if we're in debug mode
   // the first time we're used on a page.
   if ( bDebug == undefined )
   {
      // the test can be if we're on localhost (i.e. on development machine)
      /*
      var sServer = "" + Request.ServerVariables ( "SERVER_NAME" );

      bDebug = ( -1 != sServer.indexOf ( "localhost" ) );
      */

      //..or for demo purposes, if a certain QueryString exists
      bDebug = ( 0 != Request.QueryString ( "debug" ).Count );
   }

   return bDebug;
}

// ============================================
// shorthand to save me typing Response.Write all the time!
// ============================================
function Out ( sHTML )
{
   Response.Write ( sHTML );
}

// ============================================
// only display when special URL
// ============================================
function DebugOut ( sHTML )
{
   if ( !IsDebug () )
      return;

   Out ( sHTML );
}
%>
数据库开发 | .Net技术 | ASP技术 | PHP技术 | JSP技术 | 应用技术类 | 升蓝开发小组
Copyright ? 2001-2004 Shenzhen Hi-blue Software Team 升蓝开发小组 All rights reserved