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

1.在Silverlight启动页面

 1 <%@ Page Language="C#" AutoEventWireup="true" %>
 2 
 3 "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 4 "http://www.w3.org/1999/xhtml">
 5 "server">
 6     SilverlightApplication9
 7     
23     
24     
25     
61 
62 
63     
"form1" runat="server" style="height: 100%"> 64
"silverlightControlHost"> 65 <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"> 66 "source" value="ClientBin/SilverlightApplication9.xap" /> 67 "onError" value="onSilverlightError" /> 68 "initParams" value="<%= String.Format("{0}={1},{2}={3}","ClientIP", Request.UserHostAddress,"ClientName",Request.UserHostName) %>" /> 69 "background" value="white" /> 70 "minRuntimeVersion" value="5.0.61118.0" /> 71 "autoUpgrade" value="true" /> 72 "/DownloadSilverlight.aspx" style="text-decoration: none"> 73 "/Img/SLMedallion_CHS.png" alt="获取 Microsoft Silverlight" 74 style="border-style: none" /> 75 76 object> 77 78
79
80 81
View Code

2.在Silverlight.web服务端添加要显示的图片及路径、silverlight插件的两个版本(32位、64位)

3.在silverlight.web服务端添加DownloadSilverlight.aspx项

 1 using System;
 2 using System.Collections.Generic;
 3 using System.Linq;
 4 using System.Web;
 5 using System.Web.UI;
 6 using System.Web.UI.WebControls;
 7 
 8 namespace SilverlightApplication9.Web
 9 {
10     public partial class DownloadSilverlight : System.Web.UI.Page
11     {
12         protected void Page_Load(object sender, EventArgs e)
13         {
14             //string info = "客户端IP:" + Page.Request.UserHostAddress;
15             //info += "
用户信息:" + Page.User;
16 //info += "
服务器电脑名称:" + Page.Server.MachineName;
17 //info += "
当前用户电脑名称:" + System.Net.Dns.GetHostName();
18 //info += "
当前电脑名:" + System.Environment.MachineName;
19 //info += "
当前电脑所属网域:" + System.Environment.UserDomainName;
20 //info += "
当前电脑用户:" + System.Environment.UserName;
21 //info += "
";
22 //info += "
浏览器类型:" + Request.Browser.Browser;
23 //info += "
浏览器标识:" + Request.Browser.Id;
24 //info += "
浏览器版本号:" + Request.Browser.Version;
25 //info += "
浏览器是不是测试版本:" + Request.Browser.Beta;
26 ////info += "
浏览器的分辨率(像素):" + Request["width"].ToString() + "*" + Request["height"].ToString();//1280/1024 27 //info += "
";
28 //info += "
客户端的操作系统:" + Request.Browser.Platform;
29 //info += "
是不是win16系统:" + Request.Browser.Win16;
30 //info += "
是不是win32系统:" + Request.Browser.Win32;
31 //Response.Write(info); 32 33 //int loop1, loop2; 34 //NameValueCollection coll; 35 36 //// Load ServerVariable collection into NameValueCollection object. 37 //coll = Request.ServerVariables; 38 //// Get names of all keys into a string array. 39 //String[] arr1 = coll.AllKeys; 40 //for (loop1 = 0; loop1 < arr1.Length; loop1++) 41 //{ 42 // Response.Write("Key: " + arr1[loop1] + "
");
43 // String[] arr2 = coll.GetValues(arr1[loop1]); 44 // for (loop2 = 0; loop2 < arr2.Length; loop2++) 45 // { 46 // Response.Write("Value " + loop2 + ": " + Server.HtmlEncode(arr2[loop2]) + "
");
47 // } 48 //} 49 //Response.End(); 50 if (Request.ServerVariables["HTTP_USER_AGENT"].ToString().Contains("WOW64")) 51 { 52 Response.Redirect("/Silverlight/Silverlight_x64.exe"); 53 } 54 else 55 { 56 Response.Redirect("/Silverlight/Silverlight.exe"); 57 } 58 } 59 } 60 }
View Code

 

 

转载于:https://www.cnblogs.com/zxbzl/p/3836334.html

你可能感兴趣的:(silverlight 用户浏览器未安装SL插件问题)