测试对Flash功能在服务器端 [英] Testing for Flash capability on the server-side
问题描述
我开发一个ASP.NET网站,将需要支持非Flash用户。
I'm developing an ASP.NET website that will need to support non-flash users.
在情况下,用户的浏览器不支持Flash,或者他们有闪光灯禁用,我想大的开机画面下载到浏览器。
In case the user's browser doesn't support Flash, or they have Flash disabled, I'd like to download a large splash image to the browser.
不过,我不想浪费带宽下载,如果闪存的确实的渲染正常。
However I don't want to waste bandwidth downloading it if the Flash does render properly.
那么,它可以测试,使用.NET code服务器端,浏览器是否支持flash?我通过'的Request.Browser'对象看了看,也没有找到相关的闪存任何东西。
So is it possible to test, from the server-side using .NET code, whether the browser supports flash? I looked through the 'Request.Browser' object, but couldn't find anything relevant to Flash.
推荐答案
您可以尝试使用一些服务器VAR:
You might try using some server var:
HTTP_ACCEPT
反对
应用程序/ x-冲击波闪光
'HTTP_ACCEPT' against 'application/x-shockwave-flash'
不知道有关.NET但它工作的大部分时间在PHP。这不会在Safari工作,但你在做什么应该罚款。你会为自己节省时间一定带宽的95%。 PHP的例子(没有.NET,但你的想法):
Not sure about .NET but it works most of the time in php. This does not work in Safari but for what you're doing that should be fine. You'll be saving yourself some bandwidth 95% of the time. PHP example(not .NET but you get the idea):
if (strstr($_SERVER['HTTP_ACCEPT'], 'application/x-shockwave-flash')){
$hasFlash = true;
}
这篇关于测试对Flash功能在服务器端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!