从 Internet Explorer 检测 .net Framework 版本和修订版本
我知道我们可以从用户代理字符串中检测到主要版本和 SP 版本。
但是,我还需要区分修订版本,即
2.0 RTM (x86) 2.0.50727.42
2.0 RTM (Vista) 2.0.50727.312
2.0 (KB928365) 2.0.50727.832
对我来说不同,并且它们会在用户代理中报告,如下所示: Mozilla/5.0(兼容;MSIE 7.0;Windows NT 6.0;WOW64;SLCC1;.NET CLR 2.0.50727;Media Center PC 5.0;.NET CLR 3.0.04506;.NET CLR 3.5.30707; InfoPath.1; el-GR)
( http://en.wikipedia.org/wiki/List_of_. NET_Framework_versions )
任何方法都是可以接受的(Silverlight、Flash、Java 等),只要它不需要用户交互。
更新:差不多了...签名的.NET ActiveX 在中等安全级别(即在Intranet 中)上工作,在Internet 设置中不起作用。
在 IE 中托管 Windows 窗体似乎以同样的方式工作。如果我能找到如何指定我不需要高度信任即可工作......
I know we can detect the major version and SP version from user-agent string.
However, I need to distinguish between Revisions as well, i.e.
2.0 RTM (x86) 2.0.50727.42
2.0 RTM (Vista) 2.0.50727.312
2.0 (KB928365) 2.0.50727.832
are different to me, and they get reported in user-agent like this:
Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; .NET CLR 3.5.30707; InfoPath.1; el-GR)
( http://en.wikipedia.org/wiki/List_of_.NET_Framework_versions )
Any method is acceptable (Silverlight, Flash, Java etc.), as long as it does not require user interaction.
Update: Almost there... Signed .NET ActiveX works on Medium security level (i.e. in Intranet), does not work in Internet setting.
Hosting Windows Forms in IE seems to work the same way. If only I can find how to specify that i don't need high trust to work...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 .NET 中创建浏览器小程序微不足道。可能存在一些安全设置,但既然您说任何方法都是可以接受的,那么这也应该有效。从那里您就可以在浏览器中嵌入一个完全运行的 .NET 应用程序。只需像通常那样检测版本即可。
补充:我认为您还可以以某种方式指定您不需要完全信任,这将缓解安全问题。
It's trivial to create a browser applet in .NET. There might be a few security settings in the way, but since you said that any method is acceptable, this should work as well. From there you've got a fully working .NET app embedded in the browser. Just detect the version like you normally would.
Added: I think you could also somehow specify that you don't need full trust, which would ease the security problems.
我相信确定补丁级别的唯一两种方法是检查文件版本本身或读取注册表项。
不管怎样,从我有限的研究(2 分钟)来看,这听起来很难做到。不过,您也许能够编写一个ActiveX 控件来执行此操作。
I believe the only two ways to determine patch level is to either check the file versions themselves or to read a registry key.
Either way, from my limited research (2 minutes) it sounds pretty hard to do. You might be able to write an ActiveX control to do this though.