How to determine if the client is installed from the ASP.NET program installed .NET Framework

xiaoxiao2021-03-06  22

ASP.NET programs sometimes need to know if the client is installed with .NET Framework. You can get some clues with the UseERAGENT attribute of the HttpRequest object, for example:

Private Sub Page_Load (Byvale AS System.Object, Byval E AS System.Eventargs) Handles MyBase.Load

'Put User Code to Initialize The Page Here

IF not me.ispostback then

Label1.text = Request.Useragent

END IF

End Sub

Possible output is:

Mozilla / 4.0 (Compatible; Msie 6.0; Windows NT 5.1; .NET CLR 1.1.4322)

Another maybe better approach:

Request.browser.clrversion property, but:

This Property is supported Only WHEN THE User Agent Is Internet Explorer Version 5.0 and later.

If The Common Language Runtime is Not Installed on The Client, The Property Value IS 0, 0, -1, -1.

IF More Than One Version of The Common Language Runtime In Installed On The Client, Clrversion Returns The Latest Version.

转载请注明原文地址:https://www.9cbs.com/read-80249.html

New Post(0)