如果让我的Asp.net应用程序只能用IE浏览器打开 我通过Request.ServerVariables("ALL_HTTP")取得HTTP头,然后判断其http_user_agent的值,IE与netscape是有区别的,但是IE与MYIE2,TT就没有区别,(可能是因为MYIE和TT使用的是IE的内核的原因)其值是相同的,我应该如何判断用户的浏览是MYIE2,TT还是IE呢。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Javascriptvar tt_db = (document.compatMode && document.compatMode != 'BackCompat')? document.documentElement : document.body? document.body : null,tt_n = navigator.userAgent.toLowerCase();// Browser flagsvar tt_op = !!(window.opera && document.getElementById),tt_op6 = tt_op && !document.defaultView,tt_ie = tt_n.indexOf('msie') != -1 && document.all && tt_db && !tt_op,tt_n4 = (document.layers && typeof document.classes != "undefined"),tt_n6 = (!tt_op && document.defaultView && typeof document.defaultView.getComputedStyle != "undefined"),tt_w3c = !tt_ie && !tt_n6 && !tt_op && document.getElementById; 用javascript吧var an = navigator.appName;if ((an.indexOf("Microsoft") < 0 )document.write("您的浏览器无法正常运行此程序!"); javascript的navigator.appName也只能判断是MSIE还是NNS,不能区分myie2,ie,tt这些同是IE内核的浏览器 看看那个叫做雷敖的论坛,那个论坛可以认出MyIE,TT,Maxthon这些都可以。我也关注一下吧,那个论坛是PHP的,看不懂的说。 用JS在window_load事件中判断一下,代码楼上的几位兄弟已给出了! Javascriptvar tt_db = (document.compatMode && document.compatMode != 'BackCompat')? document.documentElement : document.body? document.body : null,tt_n = navigator.userAgent.toLowerCase();// Browser flagsvar tt_op = !!(window.opera && document.getElementById),tt_op6 = tt_op && !document.defaultView,tt_ie = tt_n.indexOf('msie') != -1 && document.all && tt_db && !tt_op,tt_n4 = (document.layers && typeof document.classes != "undefined"),tt_n6 = (!tt_op && document.defaultView && typeof document.defaultView.getComputedStyle != "undefined"),tt_w3c = !tt_ie && !tt_n6 && !tt_op && document.getElementById; 象 v192(魔渡众生) 说的那样 我是想识别MyIE,TT,Maxthon,不知如何操作呢 关于Request.Path 转向错误页面问题 页面上调用.EXE文件,服务器上面可以,在别人机子上执行不了 C# MSChart中 rangeBar控件 横坐标如何显示时间到分钟 c#.net 点击DataGrid行弹出窗口的问题 跨站点post提交怎么弄 如何生数据源生成为.dbf文档。 怎样把dataset数据集中的数据分批放入到多个datagrid中? 再线求救:中途退出程序要用什么语句?? 投诉:“weilin0378接分” 大家救救我啊! 怎样格式HyperLinkColumn的字符串啊?
tt_n = navigator.userAgent.toLowerCase();// Browser flags
var tt_op = !!(window.opera && document.getElementById),
tt_op6 = tt_op && !document.defaultView,
tt_ie = tt_n.indexOf('msie') != -1 && document.all && tt_db && !tt_op,
tt_n4 = (document.layers && typeof document.classes != "undefined"),
tt_n6 = (!tt_op && document.defaultView && typeof document.defaultView.getComputedStyle != "undefined"),
tt_w3c = !tt_ie && !tt_n6 && !tt_op && document.getElementById;
if ((an.indexOf("Microsoft") < 0 )
document.write("您的浏览器无法正常运行此程序!");
我也关注一下吧,那个论坛是PHP的,看不懂的说。
tt_n = navigator.userAgent.toLowerCase();// Browser flags
var tt_op = !!(window.opera && document.getElementById),
tt_op6 = tt_op && !document.defaultView,
tt_ie = tt_n.indexOf('msie') != -1 && document.all && tt_db && !tt_op,
tt_n4 = (document.layers && typeof document.classes != "undefined"),
tt_n6 = (!tt_op && document.defaultView && typeof document.defaultView.getComputedStyle != "undefined"),
tt_w3c = !tt_ie && !tt_n6 && !tt_op && document.getElementById;
我是想识别MyIE,TT,Maxthon,不知如何操作呢