是否安装了.NET Framework [英] Is .NET Framework Installed

查看:156
本文介绍了是否安装了.NET Framework的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个clickonce应用程序发布到内部网站.我想要一个允许用户安装应用程序的登录页面.这不是问题.

但是,是否可以运行一些Javascript来确定是否已安装.NET 4 Full?我想禁用未安装的安装按钮,并显示指向它的链接.

我只能找到有关是否已安装3.5以及4.0失败的信息.

在此先感谢!!

Hi All,

I have a clickonce application published to an internal website. I want to have a landing page that allows the user to install the application. This is not a problem.

However, is there some Javascript I can run to determine if .NET 4 Full is installed? I want to disable the install button if it is not installed and show a link to it.

I can only find info on finding out whether 3.5 is installed and have had no success with 4.0

Thanks in advance!!

推荐答案

您应该能够检查用户代理以确定已安装的版本,例如此脚本检查框架的版本-您可以修改4.0版本

http://msdn.microsoft.com/en-us/library/ms749404.aspx [ ^ ]

我在IE中的用户代理是

Mozilla/4.0(兼容; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; InfoPath.2).

您感兴趣的代理商是

.NET4.0C .NET框架
版本:4.0客户端配置文件

.NET4.0E .NET框架
版本:4.0扩展

您可以在IE中获得这些信息,但不一定在所有浏览器中都能获得它们....例如

http://www.hanselman.com/blog/TheNETFrameworkAndTheBrowsersUserAgentString.aspx [
You should be able to check the User Agent to determine what versions are installed, e.g. this script checks for version of the framework - you could modify for version 4.0

http://msdn.microsoft.com/en-us/library/ms749404.aspx[^]

My user agent in IE is

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; InfoPath.2).

The agent you''re interested in are

.NET4.0C .NET framework
Version : 4.0 Client Profile

.NET4.0E .NET framework
Version : 4.0 Extended

You''ll get these in IE, but not definitely in all browsers....e.g

http://www.hanselman.com/blog/TheNETFrameworkAndTheBrowsersUserAgentString.aspx[^]


这是 OriginalGriff :

安全使用户检查是否已安装.NET Framework的方法 [
This is a way suggested by OriginalGriff:

A safe way to get the user to check if the .NET framework is installed[^].

Please, all credit goes to him!

—SA


这篇关于是否安装了.NET Framework的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆