ASP pages can't be refreshed instantly, they seem to be loading indefinitely 
Author Message
 ASP pages can't be refreshed instantly, they seem to be loading indefinitely

hi all,

I have the above problem whenever I modified my ASP pages and try to refresh
the browser to see the effect. I am quite sure it has nothing to do with my
codes because I tried with adding comments only but it's still the same
problem. I suspect that IIS keep a copy of the old ASP script (compiled
form) and will only recognise the changes after a certain time interval. I
try to close my browser and wait for a certain time interval b4 re-opening
it and it's fine. So, is there anybody having this problem also ? Can
someone tell me what's is wrong here. I appreciate your advice very much.

I'm using Windows2000 server, IIS 5.0 and VBScript 5.1

My application currently only have 4 ASP pages. 'default.asp' determines the type of browser used by the user and then redirect him to 'main.asp' which is the main login page. 'login.asp' will access the database and determine whether the user has approriate access right. I wish you could advice me where is the problem after you read through the codes. Thanks a million.

p.s. it's urgent, please help me if your can. Thanks.

regards

----------- FILE NAME : default.asp ----------------------
<%
    Option Explicit    ' force variables declaration

    ' function for pattern matching
    Function RegExpTest(patrn, strng, result)
        Dim regEx, Match, Matches, tmpStr, RetStr

        RetStr = false

        Set regEx = New RegExp            ' Create a regular expression
        regEx.Pattern = patrn             ' Set pattern
        regEx.IgnoreCase = True           ' Set case insensitivity

        Set Matches = regEx.Execute(strng)    ' Execute search

        If Matches.Count > 0 Then
            For Each Match in Matches        ' Iterate Matches collection            
                result = result & Match.Value
            Next

            tmpStr = Split(result, " ", -1, 1)

            If Len(tmpStr(0)) = Len(result) Then
                tmpStr = Split(result, "/", -1, 1)
                If Len(tmpStr(0)) = Len(result) Then
                    result = "NOSPLIT"
                Else
                    result = tmpStr(1) ' take version no. only
                End If
            Else
                result = tmpStr(1) ' take version no. only            
            End If

            RetStr = true
        End If

        RegExpTest = RetStr
    End Function

    ' variables declaration
    Dim UA, BROWSER, VERSION, MAJORVER, MINORVER
    Dim JS, PLATFORM, OS
    Dim IE,IE5,IE5up,IE4,IE4up,IE3,IE3up,IE2,IE2up
    Dim NS,NS6,NS6up,NS5,NS5up,NS4,NS4up,NS3,NS3up,NS2,NS2up
    Dim pos,TEMP

    UA         =    ""
    BROWSER    =    "Unknown"
    VERSION    =    0
    MAJORVER   =    0
    MINORVER   =    0
    JS         =    0.0
    PLATFORM   =    "Unknown"
    OS         =    "Unknown"

   ' QUICK TEST VARIABLES
   ' ====================================================================
   '__________[Microsoft Internet Explorer]
   IE     =    false
   IE5    =    false
   IE5up  =    false
   IE4    =    false
   IE4up  =    false
   IE3    =    false
   IE3up  =    false
   IE2    =    false
   IE2up  =    false
   '__________[Netscape Navigator]
   NS     =    false
   NS6    =    false
   NS6up  =    false
   NS5    =    false
   NS5up  =    false
   NS4    =    false
   NS4up  =    false
   NS3    =    false
   NS3up  =    false
   NS2    =    false
   NS2up  =    false

    UA = Request.ServerVariables("HTTP_USER_AGENT")

    ' Determine Browser Name and Version
    If RegExpTest("MSIE ([0-9].[0-9a-zA-Z]{1,4})",UA,VERSION) Then
        BROWSER = "IE"
        'Response.Write "Version : " & VERSION
    ElseIf RegExpTest("Microsoft Internet Explorer ([0-9].[0-9a-zA-Z]{1,4})",UA,VERSION) Then
        BROWSER = "IE"
        'Response.Write "Version : " & VERSION
    ElseIf RegExpTest("Netscape6/([0-9].[0-9a-zA-Z]{1,4})",UA,VERSION) Then
        BROWSER = "Netscape"
        'Response.Write "Version : " & VERSION
    ElseIf RegExpTest("Mozilla/([0-9].[0-9a-zA-Z]{1,4})",UA,VERSION) Then
        BROWSER = "Netscape"
        'Response.Write "Version : " & VERSION
    Else
        BROWSER = "Unknown"
        VERSION = 0
    End If

    ' Determine Major and Minor Version
    If VERSION > 0 Then
        pos = Instr(1, VERSION,".", 1)
        If pos > 0 Then
            MAJORVER = Mid(VERSION, 1, pos-1)
            MINORVER = Mid(VERSION, pos+1, Len(VERSION))
        Else
            MAJORVER = VERSION
        End If
    End If

    ' QUICK TESTS
    ' A set of values most often sought

    ' Check [Internet Explorer]
    If StrComp("ie", BROWSER, 1) = 0 Then
        IE        =    true
        If MAJORVER = 5 Then IE5 = true
        If MAJORVER >= 5 Then IE5up = true
        If MAJORVER = 4 Then IE4 = true
        If MAJORVER >= 4 Then IE4up = true
        If MAJORVER = 3 Then IE3 = true
        If MAJORVER >= 3 Then IE3up = true
        If MAJORVER = 2 Then IE2 = true
        If MAJORVER >= 2 Then IE2up = true
    End If

    ' Check [Netscape Navigator]
    If StrComp("netscape", BROWSER, 1) = 0 Then
        If MAJORVER = 6 Then NS6 = true
        If MAJORVER >= 6 Then NS6up = true
        If MAJORVER = 5 Then NS5 = true
        If MAJORVER >= 5 Then NS5up = true
        If MAJORVER = 4 Then NS4 = true
        If MAJORVER >= 4 Then NS4up = true
        If MAJORVER = 3 Then NS3 = true
        If MAJORVER >= 3 Then NS3up = true
        If MAJORVER = 2 Then NS2 = true
        If MAJORVER >= 2 Then NS2up = true
    End If

    ' Determine Platform and OS

    ' Check for Windows 16-bit
    If RegExpTest("Win16", UA, TEMP) Then
        PLATFORM = "Win16"
        OS = "Win31"
    ElseIf RegExpTest("windows 3.1", UA, TEMP) Then
        PLATFORM = "Win16"
        OS = "Win31"
    ElseIf RegExpTest("windows 16-bit", UA, TEMP) Then
        PLATFORM = "Win16"
        OS = "Win31"
    ElseIf RegExpTest("16bit", UA, TEMP) Then
        PLATFORM = "Win16"
        OS = "Win31"
    End If

    ' Check for Windows 32-bit
    If RegExpTest("Win95", UA, TEMP) Then
        PLATFORM = "Win32"
        OS = "Win95"
    ElseIf RegExpTest("windows 95", UA, TEMP) Then
        PLATFORM = "Win32"
        OS = "Win95"
    ElseIf RegExpTest("Win98", UA, TEMP) Then
        PLATFORM = "Win32"
        OS = "Win98"
    ElseIf RegExpTest("windows 98", UA, TEMP) Then
        PLATFORM = "Win32"
        OS = "Win98"
    ElseIf RegExpTest("WinNT", UA, TEMP) Then
        PLATFORM = "Win32"
        OS = "WinNT"
    ElseIf RegExpTest("windows NT", UA, TEMP) Then
        PLATFORM = "Win32"
        OS = "WinNT"
    ElseIf RegExpTest("Win", UA, TEMP) Then
        PLATFORM = "Win32"
        OS = "Win9xNT"
    End If

    ' Assume JavaScript Version
    ' update as new versions are released
    ' Provide upward compatibilty
    If NS6up Then
        JS = 1.5
    ElseIf IE5up Then
        JS = 1.3
    ' check existing versions
    ElseIf NS6 Then
        JS = 1.5
    ElseIf NS5 Then
        JS = 1.4
    ElseIf ((NS4 And (VERSION > 4.05)) Or IE5) Then
        JS = 1.3
    ElseIf ((NS4 And (VERSION <= 4.05)) Or IE4) Then
        JS = 1.2
    ElseIf NS3 Then
        JS = 1.1
    ElseIf ((NS And (MAJORVER >= 2)) Or (IE And (MAJORVER >=3))) Then
        JS = 1.0
    'no idea
    Else
        JS = 0.0
    End If

    If IE5up Or NS4up Then ' browser is ok
        Response.Redirect("main.asp")        
    Else
%>

<html>
<head>
<title>network Camera system</title>
</head>
<body>
<table border='0' cellpadding='3' cellspacing='1'    bgcolor='#000000'>
<tr><td><font color='#ffffff'><b>browser information<b></font></td></tr>
</table>

<table border='0' cellpadding='0' cellspacing='0' bgcolor='#000000'>
<tr><td>
<table border='0' cellpadding='3' cellspacing='2' bgcolor='#000000'>
<tr><td bgcolor='#c0c0c0'>user agent</td><td bgcolor='#ffffff'><% = UA %></td></tr>
<tr><td bgcolor='#c0c0c0'>name</td><td bgcolor='#ffffff'><% = BROWSER %></td></tr>
<tr><td bgcolor='#c0c0c0'>version</td><td bgcolor='#ffffff'><% = VERSION %></td></tr>
<tr><td bgcolor='#c0c0c0'>javascript support</td><td bgcolor='#ffffff'><% = JS %></td></tr>
<tr><td bgcolor='#c0c0c0'>platform</td><td bgcolor='#ffffff'><% = PLATFORM %></td></tr>
<tr><td bgcolor='#c0c0c0'>os</td><td bgcolor='#ffffff'><% = OS %></td></tr>
</table>
</td></tr>
</table>

<p>the Network Camera Web Application requires at least Netscape Navigator 4 or Internet Explorer 5
<p><a href=' http://www.*-*-*.com/ '>get Microsoft Internet explorer</a>
<br><a href=' http://www.*-*-*.com/ '>get Netscape navigator</a>
</body>
</html>

<%
    End If
%>

----------- FILE NAME : main.asp ----------------------
<html>
<head>
<title>network Camera system</title>

<script language="javascript">

function setFocus() {
    document.login_form.userid.focus();

Quote:
}

function checkLogin() {
    if (document.login_form.userid.value == "") {
        alert("Please type in your user id");
        document.login_form.userid.focus();
    }
    else {
        document.login_form.action = "login.asp";
        document.login_form.submit();
    }

Quote:
}

</script>
</head>

<body bgcolor="#FFFFFF" onload="setfocus()">

<table align="center" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td colspan="2" valign="top"></td>
    </tr>
    <tr>
        <td width="350" valign="top"></td>
        <td width="447" valign="top"></td>
    </tr>
    <tr>
        <td align="center" height="90" valign="bottom">
        <h3>network Camera system</h3>
        </td>
        <td valign="top" rowspan="2"></td>
    </tr>
    <tr>
        <td align="center" height="90" valign="bottom">
        <h3>please Login here</h3>
        </td>
    </tr>
    <tr>
        <td align="center">
        <form name="login_form" method="post" action="login.asp">
            <table width="100%" border="0" cellspacing="5" cellpadding="5">
            <tr>
...

read more »



Sat, 14 Feb 2004 11:15:21 GMT  
 ASP pages can't be refreshed instantly, they seem to be loading indefinitely
Tuck
    At a guess, I would say it is more likely to be your browser that is
caching the old version.  If you are using IE, go to Tools | Internet
Options | Settings and set "Check for newer versions of stored pages" to
"Every visit to the page".

    I have seen similar behavior on IE browsers where this was set to either
Automatic or Never.

HTH
Ron Lounsbury



hi all,

I have the above problem whenever I modified my ASP pages and try to refresh
the browser to see the effect. I am quite sure it has nothing to do with my
codes because I tried with adding comments only but it's still the same
problem. I suspect that IIS keep a copy of the old ASP script (compiled
form) and will only recognise the changes after a certain time interval. I
try to close my browser and wait for a certain time interval b4 re-opening
it and it's fine. So, is there anybody having this problem also ? Can
someone tell me what's is wrong here. I appreciate your advice very much.

I'm using Windows2000 server, IIS 5.0 and VBScript 5.1

My application currently only have 4 ASP pages. 'default.asp' determines the
type of browser used by the user and then redirect him to 'main.asp' which
is the main login page. 'login.asp' will access the database and determine
whether the user has approriate access right. I wish you could advice me
where is the problem after you read through the codes. Thanks a million.

p.s. it's urgent, please help me if your can. Thanks.

regards

----------- FILE NAME : default.asp ----------------------
<%
    Option Explicit    ' force variables declaration

    ' function for pattern matching
    Function RegExpTest(patrn, strng, result)
        Dim regEx, Match, Matches, tmpStr, RetStr

        RetStr = false

        Set regEx = New RegExp            ' Create a regular expression
        regEx.Pattern = patrn             ' Set pattern
        regEx.IgnoreCase = True           ' Set case insensitivity

        Set Matches = regEx.Execute(strng)    ' Execute search

        If Matches.Count > 0 Then
            For Each Match in Matches        ' Iterate Matches collection
                result = result & Match.Value
            Next

            tmpStr = Split(result, " ", -1, 1)

            If Len(tmpStr(0)) = Len(result) Then
                tmpStr = Split(result, "/", -1, 1)
                If Len(tmpStr(0)) = Len(result) Then
                    result = "NOSPLIT"
                Else
                    result = tmpStr(1) ' take version no. only
                End If
            Else
                result = tmpStr(1) ' take version no. only
            End If

            RetStr = true
        End If

        RegExpTest = RetStr
    End Function

    ' variables declaration
    Dim UA, BROWSER, VERSION, MAJORVER, MINORVER
    Dim JS, PLATFORM, OS
    Dim IE,IE5,IE5up,IE4,IE4up,IE3,IE3up,IE2,IE2up
    Dim NS,NS6,NS6up,NS5,NS5up,NS4,NS4up,NS3,NS3up,NS2,NS2up
    Dim pos,TEMP

    UA         =    ""
    BROWSER    =    "Unknown"
    VERSION    =    0
    MAJORVER   =    0
    MINORVER   =    0
    JS         =    0.0
    PLATFORM   =    "Unknown"
    OS         =    "Unknown"

   ' QUICK TEST VARIABLES
   ' ====================================================================
   '__________[Microsoft Internet Explorer]
   IE     =    false
   IE5    =    false
   IE5up  =    false
   IE4    =    false
   IE4up  =    false
   IE3    =    false
   IE3up  =    false
   IE2    =    false
   IE2up  =    false
   '__________[Netscape Navigator]
   NS     =    false
   NS6    =    false
   NS6up  =    false
   NS5    =    false
   NS5up  =    false
   NS4    =    false
   NS4up  =    false
   NS3    =    false
   NS3up  =    false
   NS2    =    false
   NS2up  =    false

    UA = Request.ServerVariables("HTTP_USER_AGENT")

    ' Determine Browser Name and Version
    If RegExpTest("MSIE ([0-9].[0-9a-zA-Z]{1,4})",UA,VERSION) Then
        BROWSER = "IE"
        'Response.Write "Version : " & VERSION
    ElseIf RegExpTest("Microsoft Internet Explorer
([0-9].[0-9a-zA-Z]{1,4})",UA,VERSION) Then
        BROWSER = "IE"
        'Response.Write "Version : " & VERSION
    ElseIf RegExpTest("Netscape6/([0-9].[0-9a-zA-Z]{1,4})",UA,VERSION) Then
        BROWSER = "Netscape"
        'Response.Write "Version : " & VERSION
    ElseIf RegExpTest("Mozilla/([0-9].[0-9a-zA-Z]{1,4})",UA,VERSION) Then
        BROWSER = "Netscape"
        'Response.Write "Version : " & VERSION
    Else
        BROWSER = "Unknown"
        VERSION = 0
    End If

    ' Determine Major and Minor Version
    If VERSION > 0 Then
        pos = Instr(1, VERSION,".", 1)
        If pos > 0 Then
            MAJORVER = Mid(VERSION, 1, pos-1)
            MINORVER = Mid(VERSION, pos+1, Len(VERSION))
        Else
            MAJORVER = VERSION
        End If
    End If

    ' QUICK TESTS
    ' A set of values most often sought

    ' Check [Internet Explorer]
    If StrComp("ie", BROWSER, 1) = 0 Then
        IE        =    true
        If MAJORVER = 5 Then IE5 = true
        If MAJORVER >= 5 Then IE5up = true
        If MAJORVER = 4 Then IE4 = true
        If MAJORVER >= 4 Then IE4up = true
        If MAJORVER = 3 Then IE3 = true
        If MAJORVER >= 3 Then IE3up = true
        If MAJORVER = 2 Then IE2 = true
        If MAJORVER >= 2 Then IE2up = true
    End If

    ' Check [Netscape Navigator]
    If StrComp("netscape", BROWSER, 1) = 0 Then
        If MAJORVER = 6 Then NS6 = true
        If MAJORVER >= 6 Then NS6up = true
        If MAJORVER = 5 Then NS5 = true
        If MAJORVER >= 5 Then NS5up = true
        If MAJORVER = 4 Then NS4 = true
        If MAJORVER >= 4 Then NS4up = true
        If MAJORVER = 3 Then NS3 = true
        If MAJORVER >= 3 Then NS3up = true
        If MAJORVER = 2 Then NS2 = true
        If MAJORVER >= 2 Then NS2up = true
    End If

    ' Determine Platform and OS

    ' Check for Windows 16-bit
    If RegExpTest("Win16", UA, TEMP) Then
        PLATFORM = "Win16"
        OS = "Win31"
    ElseIf RegExpTest("windows 3.1", UA, TEMP) Then
        PLATFORM = "Win16"
        OS = "Win31"
    ElseIf RegExpTest("windows 16-bit", UA, TEMP) Then
        PLATFORM = "Win16"
        OS = "Win31"
    ElseIf RegExpTest("16bit", UA, TEMP) Then
        PLATFORM = "Win16"
        OS = "Win31"
    End If

    ' Check for Windows 32-bit
    If RegExpTest("Win95", UA, TEMP) Then
        PLATFORM = "Win32"
        OS = "Win95"
    ElseIf RegExpTest("windows 95", UA, TEMP) Then
        PLATFORM = "Win32"
        OS = "Win95"
    ElseIf RegExpTest("Win98", UA, TEMP) Then
        PLATFORM = "Win32"
        OS = "Win98"
    ElseIf RegExpTest("windows 98", UA, TEMP) Then
        PLATFORM = "Win32"
        OS = "Win98"
    ElseIf RegExpTest("WinNT", UA, TEMP) Then
        PLATFORM = "Win32"
        OS = "WinNT"
    ElseIf RegExpTest("windows NT", UA, TEMP) Then
        PLATFORM = "Win32"
        OS = "WinNT"
    ElseIf RegExpTest("Win", UA, TEMP) Then
        PLATFORM = "Win32"
        OS = "Win9xNT"
    End If

    ' Assume JavaScript Version
    ' update as new versions are released
    ' Provide upward compatibilty
    If NS6up Then
        JS = 1.5
    ElseIf IE5up Then
        JS = 1.3
    ' check existing versions
    ElseIf NS6 Then
        JS = 1.5
    ElseIf NS5 Then
        JS = 1.4
    ElseIf ((NS4 And (VERSION > 4.05)) Or IE5) Then
        JS = 1.3
    ElseIf ((NS4 And (VERSION <= 4.05)) Or IE4) Then
        JS = 1.2
    ElseIf NS3 Then
        JS = 1.1
    ElseIf ((NS And (MAJORVER >= 2)) Or (IE And (MAJORVER >=3))) Then
        JS = 1.0
    'no idea
    Else
        JS = 0.0
    End If

    If IE5up Or NS4up Then ' browser is ok
        Response.Redirect("main.asp")
    Else
%>

<html>
<head>
<title>network Camera system</title>
</head>
<body>
<table border='0' cellpadding='3' cellspacing='1'    bgcolor='#000000'>
<tr><td><font color='#ffffff'><b>browser information<b></font></td></tr>
</table>

<table border='0' cellpadding='0' cellspacing='0' bgcolor='#000000'>
<tr><td>
<table border='0' cellpadding='3' cellspacing='2' bgcolor='#000000'>
<tr><td bgcolor='#c0c0c0'>user agent</td><td bgcolor='#ffffff'><% = UA
%></td></tr>
<tr><td bgcolor='#c0c0c0'>name</td><td bgcolor='#ffffff'><% = BROWSER
%></td></tr>
<tr><td bgcolor='#c0c0c0'>version</td><td bgcolor='#ffffff'><% = VERSION
%></td></tr>
<tr><td bgcolor='#c0c0c0'>javascript support</td><td bgcolor='#ffffff'><% =
JS %></td></tr>
<tr><td bgcolor='#c0c0c0'>platform</td><td bgcolor='#ffffff'><% = PLATFORM
%></td></tr>
<tr><td bgcolor='#c0c0c0'>os</td><td bgcolor='#ffffff'><% = OS %></td></tr>
</table>
</td></tr>
</table>

<p>the Network Camera Web Application requires at least Netscape Navigator 4
or Internet Explorer 5
<p><a href='http://www.microsoft.com/windows/ie/'>get Microsoft Internet
explorer</a>
<br><a href='http://home.netscape.com/browsers/index.html'>get Netscape
navigator</a>
</body>
</html>

<%
    End If
%>

----------- FILE NAME : main.asp ----------------------
<html>
<head>
<title>network Camera system</title>

<script language="javascript">

function setFocus() {
    document.login_form.userid.focus();

Quote:
}

function checkLogin() {
    if (document.login_form.userid.value == "") {
        alert("Please type in your user id");
        document.login_form.userid.focus();
    }
    else {
        document.login_form.action = "login.asp";
        document.login_form.submit();
    }

Quote:
}

</script>
</head>

<body bgcolor="#FFFFFF" onload="setfocus()">

<table align="center" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td colspan="2" valign="top"></td>
    </tr>
    <tr>
        <td width="350" valign="top"></td>
        <td width="447" valign="top"></td>
    </tr>
    <tr>
        <td align="center" height="90" valign="bottom">
        <h3>network Camera system</h3>
        </td>
        <td valign="top" rowspan="2"></td>
    </tr>
    <tr>
        <td align="center" height="90"
...

read more »



Sat, 14 Feb 2004 19:32:33 GMT  
 ASP pages can't be refreshed instantly, they seem to be loading indefinitely
Hi, I'm running  a site that uses cookies to pass a user login and password
through the page to allow them access.  I've noticed this problem as well;
the browser will, arbitrarily it seems, cache an older version of the page.
Does anyone know of a foolproof way to pass the username and ID that would
be secure?

Regards,

Shannon


Quote:
> Tuck
>     At a guess, I would say it is more likely to be your browser that is
> caching the old version.  If you are using IE, go to Tools | Internet
> Options | Settings and set "Check for newer versions of stored pages" to
> "Every visit to the page".

>     I have seen similar behavior on IE browsers where this was set to
either
> Automatic or Never.

> HTH
> Ron Lounsbury



> hi all,

> I have the above problem whenever I modified my ASP pages and try to
refresh
> the browser to see the effect. I am quite sure it has nothing to do with
my
> codes because I tried with adding comments only but it's still the same
> problem. I suspect that IIS keep a copy of the old ASP script (compiled
> form) and will only recognise the changes after a certain time interval. I
> try to close my browser and wait for a certain time interval b4 re-opening
> it and it's fine. So, is there anybody having this problem also ? Can
> someone tell me what's is wrong here. I appreciate your advice very much.

> I'm using Windows2000 server, IIS 5.0 and VBScript 5.1

> My application currently only have 4 ASP pages. 'default.asp' determines
the
> type of browser used by the user and then redirect him to 'main.asp' which
> is the main login page. 'login.asp' will access the database and determine
> whether the user has approriate access right. I wish you could advice me
> where is the problem after you read through the codes. Thanks a million.

> p.s. it's urgent, please help me if your can. Thanks.

> regards

> ----------- FILE NAME : default.asp ----------------------
> <%
>     Option Explicit    ' force variables declaration

>     ' function for pattern matching
>     Function RegExpTest(patrn, strng, result)
>         Dim regEx, Match, Matches, tmpStr, RetStr

>         RetStr = false

>         Set regEx = New RegExp            ' Create a regular expression
>         regEx.Pattern = patrn             ' Set pattern
>         regEx.IgnoreCase = True           ' Set case insensitivity

>         Set Matches = regEx.Execute(strng)    ' Execute search

>         If Matches.Count > 0 Then
>             For Each Match in Matches        ' Iterate Matches collection
>                 result = result & Match.Value
>             Next

>             tmpStr = Split(result, " ", -1, 1)

>             If Len(tmpStr(0)) = Len(result) Then
>                 tmpStr = Split(result, "/", -1, 1)
>                 If Len(tmpStr(0)) = Len(result) Then
>                     result = "NOSPLIT"
>                 Else
>                     result = tmpStr(1) ' take version no. only
>                 End If
>             Else
>                 result = tmpStr(1) ' take version no. only
>             End If

>             RetStr = true
>         End If

>         RegExpTest = RetStr
>     End Function

>     ' variables declaration
>     Dim UA, BROWSER, VERSION, MAJORVER, MINORVER
>     Dim JS, PLATFORM, OS
>     Dim IE,IE5,IE5up,IE4,IE4up,IE3,IE3up,IE2,IE2up
>     Dim NS,NS6,NS6up,NS5,NS5up,NS4,NS4up,NS3,NS3up,NS2,NS2up
>     Dim pos,TEMP

>     UA         =    ""
>     BROWSER    =    "Unknown"
>     VERSION    =    0
>     MAJORVER   =    0
>     MINORVER   =    0
>     JS         =    0.0
>     PLATFORM   =    "Unknown"
>     OS         =    "Unknown"

>    ' QUICK TEST VARIABLES
>    ' ====================================================================
>    '__________[Microsoft Internet Explorer]
>    IE     =    false
>    IE5    =    false
>    IE5up  =    false
>    IE4    =    false
>    IE4up  =    false
>    IE3    =    false
>    IE3up  =    false
>    IE2    =    false
>    IE2up  =    false
>    '__________[Netscape Navigator]
>    NS     =    false
>    NS6    =    false
>    NS6up  =    false
>    NS5    =    false
>    NS5up  =    false
>    NS4    =    false
>    NS4up  =    false
>    NS3    =    false
>    NS3up  =    false
>    NS2    =    false
>    NS2up  =    false

>     UA = Request.ServerVariables("HTTP_USER_AGENT")

>     ' Determine Browser Name and Version
>     If RegExpTest("MSIE ([0-9].[0-9a-zA-Z]{1,4})",UA,VERSION) Then
>         BROWSER = "IE"
>         'Response.Write "Version : " & VERSION
>     ElseIf RegExpTest("Microsoft Internet Explorer
> ([0-9].[0-9a-zA-Z]{1,4})",UA,VERSION) Then
>         BROWSER = "IE"
>         'Response.Write "Version : " & VERSION
>     ElseIf RegExpTest("Netscape6/([0-9].[0-9a-zA-Z]{1,4})",UA,VERSION)
Then
>         BROWSER = "Netscape"
>         'Response.Write "Version : " & VERSION
>     ElseIf RegExpTest("Mozilla/([0-9].[0-9a-zA-Z]{1,4})",UA,VERSION) Then
>         BROWSER = "Netscape"
>         'Response.Write "Version : " & VERSION
>     Else
>         BROWSER = "Unknown"
>         VERSION = 0
>     End If

>     ' Determine Major and Minor Version
>     If VERSION > 0 Then
>         pos = Instr(1, VERSION,".", 1)
>         If pos > 0 Then
>             MAJORVER = Mid(VERSION, 1, pos-1)
>             MINORVER = Mid(VERSION, pos+1, Len(VERSION))
>         Else
>             MAJORVER = VERSION
>         End If
>     End If

>     ' QUICK TESTS
>     ' A set of values most often sought

>     ' Check [Internet Explorer]
>     If StrComp("ie", BROWSER, 1) = 0 Then
>         IE        =    true
>         If MAJORVER = 5 Then IE5 = true
>         If MAJORVER >= 5 Then IE5up = true
>         If MAJORVER = 4 Then IE4 = true
>         If MAJORVER >= 4 Then IE4up = true
>         If MAJORVER = 3 Then IE3 = true
>         If MAJORVER >= 3 Then IE3up = true
>         If MAJORVER = 2 Then IE2 = true
>         If MAJORVER >= 2 Then IE2up = true
>     End If

>     ' Check [Netscape Navigator]
>     If StrComp("netscape", BROWSER, 1) = 0 Then
>         If MAJORVER = 6 Then NS6 = true
>         If MAJORVER >= 6 Then NS6up = true
>         If MAJORVER = 5 Then NS5 = true
>         If MAJORVER >= 5 Then NS5up = true
>         If MAJORVER = 4 Then NS4 = true
>         If MAJORVER >= 4 Then NS4up = true
>         If MAJORVER = 3 Then NS3 = true
>         If MAJORVER >= 3 Then NS3up = true
>         If MAJORVER = 2 Then NS2 = true
>         If MAJORVER >= 2 Then NS2up = true
>     End If

>     ' Determine Platform and OS

>     ' Check for Windows 16-bit
>     If RegExpTest("Win16", UA, TEMP) Then
>         PLATFORM = "Win16"
>         OS = "Win31"
>     ElseIf RegExpTest("windows 3.1", UA, TEMP) Then
>         PLATFORM = "Win16"
>         OS = "Win31"
>     ElseIf RegExpTest("windows 16-bit", UA, TEMP) Then
>         PLATFORM = "Win16"
>         OS = "Win31"
>     ElseIf RegExpTest("16bit", UA, TEMP) Then
>         PLATFORM = "Win16"
>         OS = "Win31"
>     End If

>     ' Check for Windows 32-bit
>     If RegExpTest("Win95", UA, TEMP) Then
>         PLATFORM = "Win32"
>         OS = "Win95"
>     ElseIf RegExpTest("windows 95", UA, TEMP) Then
>         PLATFORM = "Win32"
>         OS = "Win95"
>     ElseIf RegExpTest("Win98", UA, TEMP) Then
>         PLATFORM = "Win32"
>         OS = "Win98"
>     ElseIf RegExpTest("windows 98", UA, TEMP) Then
>         PLATFORM = "Win32"
>         OS = "Win98"
>     ElseIf RegExpTest("WinNT", UA, TEMP) Then
>         PLATFORM = "Win32"
>         OS = "WinNT"
>     ElseIf RegExpTest("windows NT", UA, TEMP) Then
>         PLATFORM = "Win32"
>         OS = "WinNT"
>     ElseIf RegExpTest("Win", UA, TEMP) Then
>         PLATFORM = "Win32"
>         OS = "Win9xNT"
>     End If

>     ' Assume JavaScript Version
>     ' update as new versions are released
>     ' Provide upward compatibilty
>     If NS6up Then
>         JS = 1.5
>     ElseIf IE5up Then
>         JS = 1.3
>     ' check existing versions
>     ElseIf NS6 Then
>         JS = 1.5
>     ElseIf NS5 Then
>         JS = 1.4
>     ElseIf ((NS4 And (VERSION > 4.05)) Or IE5) Then
>         JS = 1.3
>     ElseIf ((NS4 And (VERSION <= 4.05)) Or IE4) Then
>         JS = 1.2
>     ElseIf NS3 Then
>         JS = 1.1
>     ElseIf ((NS And (MAJORVER >= 2)) Or (IE And (MAJORVER >=3))) Then
>         JS = 1.0
>     'no idea
>     Else
>         JS = 0.0
>     End If

>     If IE5up Or NS4up Then ' browser is ok
>         Response.Redirect("main.asp")
>     Else
> %>

> <html>
> <head>
> <title>network Camera system</title>
> </head>
> <body>
> <table border='0' cellpadding='3' cellspacing='1'    bgcolor='#000000'>
> <tr><td><font color='#ffffff'><b>browser information<b></font></td></tr>
> </table>

> <table border='0' cellpadding='0' cellspacing='0' bgcolor='#000000'>
> <tr><td>
> <table border='0' cellpadding='3' cellspacing='2' bgcolor='#000000'>
> <tr><td bgcolor='#c0c0c0'>user agent</td><td bgcolor='#ffffff'><% = UA
> %></td></tr>
> <tr><td bgcolor='#c0c0c0'>name</td><td bgcolor='#ffffff'><% = BROWSER
> %></td></tr>
> <tr><td bgcolor='#c0c0c0'>version</td><td bgcolor='#ffffff'><% = VERSION
> %></td></tr>
> <tr><td bgcolor='#c0c0c0'>javascript support</td><td bgcolor='#ffffff'><%
=
> JS %></td></tr>
> <tr><td bgcolor='#c0c0c0'>platform</td><td bgcolor='#ffffff'><% = PLATFORM
> %></td></tr>
> <tr><td bgcolor='#c0c0c0'>os</td><td bgcolor='#ffffff'><% = OS
%></td></tr>
> </table>
> </td></tr>
> </table>

> <p>the Network Camera Web Application requires at least Netscape Navigator
4
> or Internet Explorer 5
> <p><a href='http://www.microsoft.com/windows/ie/'>get Microsoft Internet
> explorer</a>
> <br><a href='http://home.netscape.com/browsers/index.html'>get Netscape
> navigator</a>
> </body>
> </html>

> <%
>     End If
> %>

> -----------

...

read more »



Sun, 15 Feb 2004 21:26:24 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. how do I display a 'page loading...'- image while actual page is loading

2. I am getting errors I can't pin down

3. I am can't use StdType.StdPicture and stdole.StdPicture

4. I am looking for a HTTP/1.1 ASP component

5. I am looking for a HTTP/1.1 ASP component

6. When is 5:00 AM not 5:00 AM? When it's 5:00 AM.

7. I am trying to update a record, i am not using data control

8. I am learning VB.NET and am wondering....

9. I am trying to update a record, i am not using data control

10. Just the BASIC's ma'am.

11. In VB6 I am Printing Loads of data under Win 2000

12. ActiveX DLL and ASP - What am I missing?

 

 
Powered by phpBB® Forum Software