home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_03.cab / default.asp9 < prev    next >
Text File  |  1997-11-12  |  5KB  |  196 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <%
  6.     Const L_TITLE_TEXT = "Internet Service Manager (HTML) "
  7.     Const L_LIVESCRIPT_TEXT = "This page requires a newer version of LiveScript to view. Do you want to upgrade now?"
  8. %>
  9.  
  10. <%
  11.  
  12. function MinVer(browserver,brwminver)
  13.     MinVer = (browserver >= brwminver)
  14.     
  15. end function
  16.  
  17. function GetBrowserVer(browserstr)
  18.     dim  browserver, i, curchr
  19.     browserver = ""
  20.     
  21.     for i = 1 to len(browserstr)    
  22.         curchr = Mid(browserstr, i,1)
  23.         if isNumeric(curchr) or curchr = "." then
  24.             browserver = browserver & curchr
  25.         end if
  26.         if browserver <> "" and not (isNumeric(curchr) or curchr = ".") then
  27.             exit for
  28.         end if
  29.     next
  30.  
  31.     GetBrowserVer = browserver
  32. end function
  33.  
  34. On Error Resume Next
  35. Dim browserobj, browserkey, browserok,browserver,agentstr
  36.  
  37. browserkey = "Unknown Browser"
  38. agentstr = Request.ServerVariables("HTTP_USER_AGENT")
  39. Session("CanBrowse") = True
  40.     
  41. if Request.Querystring("browserok") <> "" or Request.QueryString("FONTSIZE") <> "" then    
  42.     browserok = True
  43. else
  44.     if Instr(agentstr, "MSIE") then
  45.             browserver = CInt(GetBrowserVer(Mid(agentstr,InStr(agentstr,"MSIE"))))
  46.             browserok=MinVer(browserver,3)    
  47.             browserKey = "IE" & browserver
  48.             Session("IsIE") = True
  49.     else
  50.         Session("IsIE") = False
  51.         if Instr(agentstr,"Mozilla") then
  52.         
  53.             browserver = CInt(GetBrowserVer(agentstr))    
  54.             browserKey = "Netscape"    
  55.             
  56.             if InStr(agentstr, "Win") > 0 then
  57.                     browserok=MinVer(browserver,3)    
  58.             else
  59.                     browserok=MinVer(browserver,4)
  60.             end if
  61.         else
  62.             browserok = false
  63.         end if
  64.     end if
  65.     Session("Browser") = browserkey
  66.     Session("IsMac") = InStr(agentstr, "Mac") > 0
  67.  
  68.     if Session("IsMac") then
  69.         Session("CanBrowse") = False
  70.     end if
  71. end if
  72. %>
  73.  
  74. <% if browserok then %>    
  75.  
  76.     <%
  77.     if Request.QueryString("FONTSIZE") <> "" then 
  78.         Response.Cookies("HTMLA")("FONTSIZE")=Request.QueryString("FONTSIZE") 
  79.         Response.Cookies("HTMLA").expires=#December 31, 2000 1:00:00 AM#        
  80.         Session("FONTSIZE")=Request.QueryString("FONTSIZE")
  81.         Session.timeout=200
  82.     else
  83.         Session("FONTSIZE") = Request.Cookies("HTMLA")("FONTSIZE")
  84.     end if
  85.     %>
  86.     
  87.     <html>        
  88.  
  89.  
  90.     <% if Session("IsIE") then %>
  91.         <script language="JavaScript">
  92.         // Determine the version number.
  93.         var version;
  94.         var requiredVersion=2;
  95.         if (typeof(ScriptEngineMajorVersion) + ""=="undefined")
  96.         {
  97.             version=1;
  98.         }
  99.         else
  100.         {
  101.             version=ScriptEngineMajorVersion();
  102.         }
  103.  
  104.         // Prompt client and navigate to download page.
  105.  
  106.         if (version < requiredVersion)
  107.         {
  108.             if (confirm("<%= L_LIVESCRIPT_TEXT %>"))
  109.             {            
  110.                 self.location.href="http://www.microsoft.com/msdownload/scripting.htm";
  111.             }
  112.         }
  113.         </script>
  114.     <% end if %>
  115.     
  116.     
  117.     
  118.     <head>
  119.     <title><%= L_TITLE_TEXT %></title>
  120.     </head>
  121.     
  122.     <SCRIPT LANGUAGE="JavaScript">
  123.     <% if Session("IsIE") then %>
  124.     if (version >= requiredVersion)
  125.     {
  126.     <% end if %>
  127.         if (newBrowser()){
  128.             self.location.href = "iisnew.asp";
  129.         }
  130.         else{
  131.             self.location.href = "iis.asp";
  132.         }
  133.     <% if Session("IsIE") then %>    
  134.     }
  135.     <% end if %>
  136.     
  137.     function newBrowser(){
  138.         //Checks for existence of cookie
  139.         cookiestr="<%= Session("FONTSIZE") %>"
  140.         brwser="<%= Session("BROWSER") %>"        
  141.         return (cookiestr == "");
  142.     }
  143.  
  144.     </SCRIPT>
  145.     
  146.     <body BGCOLOR="#000000">
  147.     </body>
  148.  
  149. <% else %>
  150.  
  151.     <html>        
  152.     <body bgcolor="#000000" text="#FFFFFF" link="#FFCC00" vlink="#FFCC00" alink="#FFCC00"topmargin="0" leftmargin="0" STYLE="font-face: Helv,Arial; font-size:10pt;">
  153.     <img src="images/iisttl.gif">
  154.     
  155.     <table cellpadding="0" width="600">
  156.     <tr>
  157.     <td width = 190> 
  158.     </td>
  159.     <td width = 400>
  160.     <font face="HELV,ARIAL" size=2>
  161.     Your web browser has not been tested to administer IIS 4.0.<p>
  162.     </FONT>
  163.     <font face="HELV,ARIAL" size=1>
  164.     <P>
  165.     You may continue to use the Ineternet Service Manager (HTML) with your current browser,
  166.     but you may experience problems.
  167.     <P>
  168.     For best viewing, we recommend that you install the released version of Microsoft® Internet Explorer.
  169.     You can<a href="http://www.microsoft.com/ie/default.asp"> download it</a> now!
  170.     <P>    
  171.     <A HREF="default.asp?browserok=True">Continue with my current browser.</A>
  172.     
  173.     <p>
  174.     <hr>
  175.     <B>    Minimum Browser Requirements:</B>
  176.     <P>    
  177.     <B>Windows</B><BR>
  178.     Microsoft® Internet Explorer 3.02<BR>
  179.     Netscape Navigator® 3.0<BR>
  180.  
  181.     <P>
  182.     <B>Macintosh</B><BR>
  183.     Microsoft® Internet Explorer 3.01<BR>
  184.     Netscape Navigator® 4.03<BR>
  185.  
  186.     <P>
  187.     <B>Unix</B><BR>
  188.     Netscape Navigator® 4.03<BR>
  189.     </font>
  190.     </td>
  191.     </tr>
  192.     </table>
  193.     
  194.     </body>
  195.     <% end if %>
  196. </html>