当前位置:首页
开发技术指南» 文章正文
    引言:

    摘要: 类的创建有没有几个例子推荐一下? 如方法,属性,事件等. 菜鸟正在学习,... ......
    摘要: execute sp_attach_db @dbname = n<database_name, sysname, 111>, @filename1 = n<filename1, nvarchar(260), d:111.mdf>, @filename2 = n<filename2, nvarchar(260), d:\111_log.ldf> go 错误......


高分

有沒有測試客戶端系統的函數,比如用戶所使用的系統   是繁體   系統   還是簡體   系統,或者測試客戶端的區域設置的函數!!  
  急!!在線等!!

NO.1   作者: yjgx007

我只知道除了Request.ServerVariables得到客户端浏览器信息,还可以用JScript的navigator对象得到系统/版本等  
   
  详见MSDN

NO.2   作者: yangzixp

ServerVariables  
  The   ServerVariables   collection   retrieves   the   values   of   predetermined   environment   variables.  
   
  Syntax  
  Request.ServerVariables   (server   environment   variable)    
   
  Parameters  
  server   environment   variable    
  Specifies   the   name   of   the   server   environment   variable   to   retrieve.   It   can   be   one   of   the   following   values.   Variable   Description    
  ALL_HTTP   All   HTTP   headers   sent   by   the   client.    
  ALL_RAW   Retrieves   all   headers   in   the   raw-form.   The   difference   between   ALL_RAW   and   ALL_HTTP   is   that   ALL_HTTP   places   an   HTTP_   prefix   before   the   header   name   and   the   header-name   is   always   capitalized.   In   ALL_RAW   the   header   name   and   values   appear   as   they   are   sent   by   the   client.      
  APPL_MD_PATH   Retrieves   the   metabase   path   for   the   (WAM)   Application   for   the   ISAPI   DLL.    
  APPL_PHYSICAL_PATH   Retrieves   the   physical   path   corresponding   to   the   metabase   path.   IIS   converts   the   APPL_MD_PATH   to   the   physical   (directory)   path   to   return   this   value.    
  AUTH_PASSWORD   The   value   entered   in   the   clients   authentication   dialog.   This   variable   is   only   available   if   Basic   authentication   is   used.      
  AUTH_TYPE   The   authentication   method   that   the   server   uses   to   validate   users   when   they   attempt   to   access   a   protected   script.    
  AUTH_USER   Raw   authenticated   user   name.      
  CERT_COOKIE   Unique   ID   for   client   certificate,   Returned   as   a   string.   Can   be   used   as   a   signature   for   the   whole   client   certificate.    
  CERT_FLAGS   bit0   is   set   to   1   if   the   client   certificate   is   present.  
  bit1   is   set   to   1   if   the   Certifying   Authority   of   the   client   certificate   is   invalid   (not   in   the   list   of   recognized   CA   on   the   server).  
   
  CERT_ISSUER   Issuer   field   of   the   client   certificate   (O=MS,   OU=IAS,   CN=user   name,   C=USA).    
  CERT_KEYSIZE   Number   of   bits   in   Secure   Sockets   Layer   connection   key   size.   For   example,   128.    
  CERT_SECRETKEYSIZE   Number   of   bits   in   server   certificate   private   key.   For   example,   e.g.   1024.    
  CERT_SERIALNUMBER   Serial   number   field   of   the   client   certificate.    
  CERT_SERVER_ISSUER   Issuer   field   of   the   server   certificate.    
  CERT_SERVER_SUBJECT   Subject   field   of   the   server   certificate.    
  CERT_SUBJECT   Subject   field   of   the   client   certificate.    
  CONTENT_LENGTH   The   length   of   the   content   as   given   by   the   client.      
  CONTENT_TYPE   The   data   type   of   the   content.   Used   with   queries   that   have   attached   information,   such   as   the   HTTP   queries   GET,   POST,   and   PUT.    
  GATEWAY_INTERFACE   The   revision   of   the   CGI   specification   used   by   the   server.   The   format   is   CGI/revision.      
  HTTP_<HeaderName>   The   value   stored   in   the   header   HeaderName.   Any   header   other   than   those   listed   in   this   table   must   be   prefixed   by   HTTP_   in   order   for   the   ServerVariables   collection   to   retrieve   its   value.  
  Note     The   server   interprets   any   underscore   (_)   characters   in   HeaderName   as   dashes   in   the   actual   header.   For   example   if   you   specify   HTTP_MY_HEADER,   the   server   searches   for   a   header   sent   as   MY-HEADER.    
   
  HTTPS   Returns   ON   if   the   request   came   in   through   secure   channel   (SSL)   or   it   returns   OFF   if   the   request   is   for   a   non-secure   channel.    
  HTTPS_KEYSIZE   Number   of   bits   in   Secure   Sockets   Layer   connection   key   size.   For   example,   128.    
  HTTPS_SECRETKEYSIZE   Number   of   bits   in   server   certificate   private   key.   For   example,   1024.    
  HTTPS_SERVER_ISSUER   Issuer   field   of   the   server   certificate.    
  HTTPS_SERVER_SUBJECT   Subject   field   of   the   server   certificate.    
  INSTANCE_ID   The   ID   for   the   IIS   instance   in   textual   format.   If   the   instance   ID   is   1,   it   appears   as   a   string.   You   can   use   this   variable   to   retrieve   the   ID   of   the   Web-server   instance   (in   the   metabase)   to   which   the   request   belongs.    
  INSTANCE_META_PATH   The   metabase   path   for   the   instance   of   IIS   that   responds   to   the   request.    
  LOCAL_ADDR   Returns   the   Server   Address   on   which   the   request   came   in.   This   is   important   on   multi-homed   machines   where   there   can   be   multiple   IP   addresses   bound   to   a   machine   and   you   want   to   find   out   which   address   the   request   used.    
  LOGON_USER   The   Windows   NT&reg;   account   that   the   user   is   logged   into.    
  PATH_INFO   Extra   path   information   as   given   by   the   client.   You   can   access   scripts   by   using   their   virtual   path   and   the   PATH_INFO   server   variable.   If   this   information   comes   from   a   URL,   it   is   decoded   by   the   server   before   it   is   passed   to   the   CGI   script.    
  PATH_TRANSLATED   A   translated   version   of   PATH_INFO   that   takes   the   path   and   performs   any   necessary   virtual-to-physical   mapping.    
  QUERY_STRING   Query   information   stored   in   the   string   following   the   question   mark   (?)   in   the   HTTP   request.      
  REMOTE_ADDR   The   IP   address   of   the   remote   host   making   the   request.      
  REMOTE_HOST   The   name   of   the   host   making   the   request.   If   the   server   does   not   have   this   information,   it   will   set   REMOTE_ADDR   and   leave   this   empty.    
  REMOTE_USER   Unmapped   user-name   string   sent   in   by   the   User.   This   is   the   name   that   is   really   sent   by   the   user   as   opposed   to   the   ones   that   are   modified   by   any   authentication   filter   installed   on   the   server.    
  REQUEST_METHOD   The   method   used   to   make   the   request.   For   HTTP,   this   is   GET,   HEAD,   POST,   and   so   on.    
  SCRIPT_NAME   A   virtual   path   to   the   script   being   executed.   This   is   used   for   self-referencing   URLs.    
  SERVER_NAME   The   servers   host   name,   DNS   alias,   or   IP   address   as   it   would   appear   in   self-referencing   URLs.    
  SERVER_PORT   The   port   number   to   which   the   request   was   sent.    
  SERVER_PORT_SECURE   A   string   that   contains   either   0   or   1.   If   the   request   is   being   handled   on   the   secure   port,   then   this   will   be   1.   Otherwise,   it   will   be   0.    
  SERVER_PROTOCOL   The   name   and   revision   of   the   request   information   protocol.   The   format   is   protocol/revision.    
  SERVER_SOFTWARE   The   name   and   version   of   the   server   software   that   fabiaos   the   request   and   runs   the   gateway.   The   format   is   name/version.    
  URL     Gives   the   base   portion   of   the   URL.    
   
   
  Remarks  
  If   a   client   sends   a   header   other   than   those   specified   in   the   preceding   table,   you   can   retrieve   the   value   of   that   header   by   prefixing   the   header   name   with   HTTP_   in   the   call   to   Request.ServerVariables.   For   example,   if   the   client   sent   this   header  
   
  SomeNewHeader:SomeNewValue  
   
  you   could   retrieve   SomeNewValue   by   using   the   following   syntax  
   
  <%   Request.ServerVariables("HTTP_SomeNewHeader")   %>  
   
  You   can   use   an   iterator   to   loop   through   each   server   variable   name.   For   example,   the   following   script   prints   out   all   of   the   server   variables   in   a   table.  
   
  <TABLE>  
  <TR><TD><B>Server   Variable</B></TD><TD><B>Value</B></TD></TR>  
  <%   For   Each   name   In   Request.ServerVariables   %>    
  <TR><TD>   <%=   name   %>   </TD><TD>     <%=   Request.ServerVariables(name)   %>   </TD></TR>  
  </TABLE>  
  <%   Next   %>    
   
  Example  
  The   following   example   uses   the   Request   object   to   display   several   server   variables.  
   
  <HTML>  
  <!--   This   example   displays   the   content   of   several   ServerVariables.   -->    
  ALL_HTTP   server   variable   =    
  <%=   Request.ServerVariables("ALL_HTTP")   %>   <BR>  
  CONTENT_LENGTH   server   variable   =    
  <%=   Request.ServerVariables("CONTENT_LENGTH")   %>   <BR>    
  CONTENT_TYPE   server   variable   =    
  <%=   Request.ServerVariables("CONTENT_TYPE")   %>   <BR>  
  QUERY_STRING   server   variable   =    
  <%=   Request.ServerVariables("QUERY_STRING")   %>   <BR>    
  SERVER_SOFTWARE   server   variable   =    
  <%=   Request.ServerVariables("SERVER_SOFTWARE")   %>   <BR>    
  </HTML>  
   
  The   next   example   uses   the   ServerVariables   collection   to   insert   the   name   of   the   server   into   a   hyperlink.    
   
  <A   HREF   =   "http://<%=   Request.ServerVariables("SERVER_NAME")   %>  
  /scripts/MyPage.asp">Link   to   MyPage.asp</A>  
   
  Applies   To  
  Request   Object    
   
  See   Also  
  ClientCertificate,   Cookies,   Form,   QueryString    
   
 

NO.3   作者: yangzixp

ALL_HTTP   客户端发送的所有   HTTP   标题文件。    
  CONTENT_LENGTH   客户端发出内容的长度。      
  CONTENT_TYPE   内容的数据类型。如:“text/html”。同附加信息   的查询一起使用,如   HTTP   查询   GET、POST   和   PUT。    
  LOCAL_ADDR   返回接受请求的服务器地址。如果在绑定多   个   IP   地址的多宿主机器上查找请求所使用的地址   时,这条变量非常重要。    
  LOGON_USER   用户登录   Windows   NT   的帐号。    
  QUERY_STRING   查询   HTTP   请求中问号后的信息。      
  REMOTE_ADDR   发出请求的远程主机   (client)   的   IP   地址。      
  REMOTE_HOST   发出请求的主机   (client)   名称。如果服务器无此   信息,它将设置为空的 MOTE_ADDR   变量。    
  REQUEST_METHOD   该方法用于提出请求。相当于用于   HTTP   的   GET、HEAD、POST等   等。    
  SERVER_NAME   出现在自引用   URL   中的服务器主机名、DNS   化名   或   IP   地址。    
  SERVER_PORT   发送请求的端口号。

NO.4   作者: xieyj

使用这个测试:  
  <TABLE>  
  <TR><TD><B>Server   Variable</B></TD><TD><B>Value</B></TD></TR>  
  <%   For   Each   name   In   Request.ServerVariables   %>    
  <TR><TD>   <%=   name   %>   :</TD><TD>     <%=   Request.ServerVariables(name)   %>   <br></TD></TR>  
  </TABLE>  
  <%   Next   %>


 ·在寒假期间各位的计划    »显示摘要«
    摘要: 我想在寒假看书,有哪位大虾能介绍一些计算机网站建设方面的书啊!! ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE