您的位置:首页 > 其它

silverlight 用户浏览器未安装SL插件问题

2014-07-10 18:07 239 查看
1.在Silverlight启动页面

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SilverlightApplication9.Web
{
public partial class DownloadSilverlight : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//string info = "客户端IP:" + Page.Request.UserHostAddress;
//info += "<br/>用户信息:" + Page.User;
//info += "<br/>服务器电脑名称:" + Page.Server.MachineName;
//info += "<br/>当前用户电脑名称:" + System.Net.Dns.GetHostName();
//info += "<br/>当前电脑名:" + System.Environment.MachineName;
//info += "<br/>当前电脑所属网域:" + System.Environment.UserDomainName;
//info += "<br/>当前电脑用户:" + System.Environment.UserName;
//info += "<hr/>";
//info += "<br/>浏览器类型:" + Request.Browser.Browser;
//info += "<br/>浏览器标识:" + Request.Browser.Id;
//info += "<br/>浏览器版本号:" + Request.Browser.Version;
//info += "<br/>浏览器是不是测试版本:" + Request.Browser.Beta;
////info += "<br/>浏览器的分辨率(像素):" + Request["width"].ToString() + "*" + Request["height"].ToString();//1280/1024
//info += "<hr/>";
//info += "<br/>客户端的操作系统:" + Request.Browser.Platform;
//info += "<br/>是不是win16系统:" + Request.Browser.Win16;
//info += "<br/>是不是win32系统:" + Request.Browser.Win32;
//Response.Write(info);

//int loop1, loop2;
//NameValueCollection coll;

//// Load ServerVariable collection into NameValueCollection object.
//coll = Request.ServerVariables;
//// Get names of all keys into a string array.
//String[] arr1 = coll.AllKeys;
//for (loop1 = 0; loop1 < arr1.Length; loop1++)
//{
//    Response.Write("Key: " + arr1[loop1] + "<br>");
//    String[] arr2 = coll.GetValues(arr1[loop1]);
//    for (loop2 = 0; loop2 < arr2.Length; loop2++)
//    {
//        Response.Write("Value " + loop2 + ": " + Server.HtmlEncode(arr2[loop2]) + "<br>");
//    }
//}
//Response.End();
if (Request.ServerVariables["HTTP_USER_AGENT"].ToString().Contains("WOW64"))
{
Response.Redirect("/Silverlight/Silverlight_x64.exe");
}
else
{
Response.Redirect("/Silverlight/Silverlight.exe");
}
}
}
}


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: