Detecting .NET

Discussion in 'ASP .Net' started by Vic, Nov 5, 2003.

  1. Vic

    Vic Guest

    Hello, All.

    Is there any way for an ASP.NET page to detect whether a client has .NET
    framework installed (preferebly to also determine the version). So, the
    resultant application would look something like that:

    User clicks a button called "Detect .NET version" on a page1.apsx. The
    result is a label that reads "you have .NET version 1.1 installed" or ".NET
    framework isn't detected on your PC".

    Any hints/links are greatly appreciated.

    Thanks.
    Vic
     
    Vic, Nov 5, 2003
    #1
    1. Advertising

  2. yes, it's in the user agent, http refer string

    you could do a comparison on the string or use a regex to see if it's there

    examples
    -------------------------------------

    version 1:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)

    both versions:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)


    not there:
    Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4) Gecko/20030624 Netscape/7.1

    Mozilla/5.0 (compatible; Konqueror/3.0-rc3; i686 Linux; 20021211)






    "Vic" <> wrote in message news:...
    > Hello, All.
    >
    > Is there any way for an ASP.NET page to detect whether a client has .NET
    > framework installed (preferebly to also determine the version). So, the
    > resultant application would look something like that:
    >
    > User clicks a button called "Detect .NET version" on a page1.apsx. The
    > result is a label that reads "you have .NET version 1.1 installed" or ".NET
    > framework isn't detected on your PC".
    >
    > Any hints/links are greatly appreciated.
    >
    > Thanks.
    > Vic
    >
    >
     
    Chance Hopkins, Nov 5, 2003
    #2
    1. Advertising

  3. Hello

    As Chance stated you can use the user agent header. The easier way is using
    Request.Browser.ClrVersion Property. Actually this is the same, method
    because .NET detects the ClrVesion by parsing the user agent string. So you
    will have .NET parse it instead of using regular expressions.

    Best regards
    Sherif

    "Vic" <> wrote in message
    news:...
    > Hello, All.
    >
    > Is there any way for an ASP.NET page to detect whether a client has .NET
    > framework installed (preferebly to also determine the version). So, the
    > resultant application would look something like that:
    >
    > User clicks a button called "Detect .NET version" on a page1.apsx. The
    > result is a label that reads "you have .NET version 1.1 installed" or

    ".NET
    > framework isn't detected on your PC".
    >
    > Any hints/links are greatly appreciated.
    >
    > Thanks.
    > Vic
    >
    >
     
    Sherif ElMetainy, Nov 5, 2003
    #3
  4. Vic

    Vic Guest

    Thanks.
    Vic

    "Chance Hopkins" <> wrote in
    message news:...
    > yes, it's in the user agent, http refer string
    >
    > you could do a comparison on the string or use a regex to see if it's

    there
    >
    > examples
    > -------------------------------------
    >
    > version 1:
    > Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)
    >
    > both versions:
    > Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET

    CLR 1.1.4322)
    >
    >
    > not there:
    > Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4)

    Gecko/20030624 Netscape/7.1
    >
    > Mozilla/5.0 (compatible; Konqueror/3.0-rc3; i686 Linux; 20021211)
    >
    >
    >
    >
    >
    >
    > "Vic" <> wrote in message

    news:...
    > > Hello, All.
    > >
    > > Is there any way for an ASP.NET page to detect whether a client has .NET
    > > framework installed (preferebly to also determine the version). So, the
    > > resultant application would look something like that:
    > >
    > > User clicks a button called "Detect .NET version" on a page1.apsx. The
    > > result is a label that reads "you have .NET version 1.1 installed" or

    ".NET
    > > framework isn't detected on your PC".
    > >
    > > Any hints/links are greatly appreciated.
    > >
    > > Thanks.
    > > Vic
    > >
    > >

    >
    >
     
    Vic, Nov 5, 2003
    #4
  5. Vic

    Vic Guest

    Thanks.
    Vic

    "Sherif ElMetainy" <> wrote in message
    news:%...
    > Hello
    >
    > As Chance stated you can use the user agent header. The easier way is

    using
    > Request.Browser.ClrVersion Property. Actually this is the same, method
    > because .NET detects the ClrVesion by parsing the user agent string. So

    you
    > will have .NET parse it instead of using regular expressions.
    >
    > Best regards
    > Sherif
    >
    > "Vic" <> wrote in message
    > news:...
    > > Hello, All.
    > >
    > > Is there any way for an ASP.NET page to detect whether a client has .NET
    > > framework installed (preferebly to also determine the version). So, the
    > > resultant application would look something like that:
    > >
    > > User clicks a button called "Detect .NET version" on a page1.apsx. The
    > > result is a label that reads "you have .NET version 1.1 installed" or

    > ".NET
    > > framework isn't detected on your PC".
    > >
    > > Any hints/links are greatly appreciated.
    > >
    > > Thanks.
    > > Vic
    > >
    > >

    >
    >
     
    Vic, Nov 5, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul

    Re: Detecting net nanny

    Paul, Jul 12, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    430
  2. Yan-Hong Huang[MSFT]

    RE: Detecting net nanny

    Yan-Hong Huang[MSFT], Jul 15, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    445
    Yan-Hong Huang[MSFT]
    Jul 15, 2003
  3. Roz Lee
    Replies:
    1
    Views:
    6,981
    alex bowers
    Dec 11, 2003
  4. ASP.Confused

    ASP.NET - Detecting memory leaks

    ASP.Confused, Jul 16, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,790
    Marina
    Jul 16, 2004
  5. Simon
    Replies:
    3
    Views:
    28,311
    Scott M.
    Oct 11, 2004
Loading...

Share This Page