Visualizzazione dei risultati da 1 a 4 su 4

Discussione: determinare broswer

  1. #1

    determinare broswer

    Salve a tutti,
    inserendo questo codice,
    codice:
    <%
    Set browser=Server.CreateObject("MSWC.BrowserType")
    If browser.Browser="IE" Then
    response.write("")
    else
    response.redirect("../errore.htm")
    end if
    %>
    permetto alla pagina di verificare il tipo di broswer che utilizza l'utente. Ma se volessi il controllo di Safari, o di Firefox, Netscape, Opera....che devo scrivere al posto di IE ?....
    Ho provato e riprovato...ma niente...
    Qualkuno sa aiutarmi?
    By SirSeymour !!!

  2. #2
    http://www.webmasterpoint.org/asp/pratica/165.asp

    testalo con internet explorer, firefox,opera e safari e vedi che ti dice, da li fai l'if, altrimenti cerchi MSWC.BrowserType su GOOGLE e ti spulci tra i risultati che ti tira fuori che sono assai


  3. #3

    grazie

    grazie per il consiglio.
    Giusto per chi avrà il problema come me, pubblico una possibile soluzione:

    codice:
    <%
    ' Browser Detection: 
    ' Place this code at the top of your ASP page.
    
    Set thisBrowser = Server.CreateObject("MSWC.BrowserType") 
    
    If thisBrowser.Browser = "IE" And CInt(thisBrowser.Version) >= 3 Then 
         Browser =  True  ' detected IE 3 through 5.5
    
    ElseIf InStr(Request.ServerVariables("HTTP_USER_AGENT"), "MSIE 6") then
         Browser = True   ' detected IE 6 or later...
    
    ElseIf InStr(Request.ServerVariables("HTTP_USER_AGENT"), "Netscape/") Then 
         Browser = True   ' detected Netscape 7.x or later
    ElseIf InStr(Request.ServerVariables("HTTP_USER_AGENT"), "Safari/") Then 
       ' detected Safari 1.x or later
         Browser = True
    Else
       ' detected WebTV, Opera, or other non-compatible browser
         Browser = False
    End If 
    %>
    By SirSeymour !!!

  4. #4

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.