The following works in ASP.NET:

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
        Dim uaStrings = Me.Request.UserAgent.Split(New Char() {";"})
        Dim s As String
        Dim found As Boolean = False
        Dim fv As String

        For Each s In uaStrings
            'Look for " .NET CLR 1.0.xxxx)"
            If (s.StartsWith(" .NET CLR 1.0.")) Then
                fv = s.Trim()
                Dim i As Integer = fv.IndexOf(")")
                If (i <> -1) Then
                    fv = fv.Substring(0, i)
                End If
                found = True
            End If
        Next

        If Not found Then
            Server.Transfer("Lame.html")
        End If

        Dim buildNo As Integer = CInt(fv.Substring(fv.LastIndexOf(".") +
1, 4))
        If buildNo < 3423 Then
            Server.Transfer("oldbuild.html")
        End If

        Label1.Text = fv + " is installed on your machine"
    End Sub

 


-----Original Message-----
From: Patrick Burrows [mailto:[EMAIL PROTECTED]] 
Sent: Friday, May 03, 2002 1:40 PM
To: [EMAIL PROTECTED]
Subject: [DOTNET] Detecting DotNet from the browser

Is there a way to detect whether or not the DotNet runtime has been
installed on a user's machine from the Browser? I'd like to write a web
page that detects if it is installed or not, and then either direct them
to a download page for the dotnet install, or the download page for my
app. 




--
Patrick Burrows
What have I ever done to make you treat me 
so disrespectfully? If you'd come to me in 
friendship, then this scum that ruined your 
daughter would be suffering this very day. 
And if by chance an honest man like yourself 
should make enemies, then they would become 
my enemies. And then they would fear you.
--------------------
Now Playing: natalie merchant & tracy chapman - in the ghetto (live)
--------------------

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to