1.在Silverlight启动页面

 <%@ Page Language="C#" AutoEventWireup="true" %>

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>SilverlightApplication9</title>
<style type="text/css">
html, body {
height: %;
overflow: auto;
} body {
padding: ;
margin: ;
} #silverlightControlHost {
height: %;
text-align: center;
}
</style>
<script type="text/javascript" src="SplashScreen.js"></script>
<script type="text/javascript" src="Silverlight.js"></script>
<script type="text/javascript">
function onSilverlightError(sender, args) {
var appSource = "";
if (sender != null && sender != ) {
appSource = sender.getHost().Source;
} var errorType = args.ErrorType;
var iErrorCode = args.ErrorCode; if (errorType == "ImageError" || errorType == "MediaError") {
return;
} var errMsg = "Silverlight 应用程序中未处理的错误 " + appSource + "\n"; errMsg += "代码: " + iErrorCode + " \n";
errMsg += "类别: " + errorType + " \n";
errMsg += "消息: " + args.ErrorMessage + " \n"; if (errorType == "ParserError") {
errMsg += "文件: " + args.xamlFile + " \n";
errMsg += "行: " + args.lineNumber + " \n";
errMsg += "位置: " + args.charPosition + " \n";
}
else if (errorType == "RuntimeError") {
if (args.lineNumber != ) {
errMsg += "行: " + args.lineNumber + " \n";
errMsg += "位置: " + args.charPosition + " \n";
}
errMsg += "方法名称: " + args.methodName + " \n";
} throw new Error(errMsg);
}
</script>
</head>
<body>
<form id="form1" runat="server" style="height: 100%">
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/SilverlightApplication9.xap" />
<param name="onError" value="onSilverlightError" />
<param name="initParams" value="<%= String.Format("{}={},{}={}","ClientIP", Request.UserHostAddress,"ClientName",Request.UserHostName) %>" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="5.0.61118.0" />
<param name="autoUpgrade" value="true" />
<a href="/DownloadSilverlight.aspx" style="text-decoration: none">
<img src="/Img/SLMedallion_CHS.png" alt="获取 Microsoft Silverlight"
style="border-style: none" />
</a>
</object>
<iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px; border: 0px"></iframe>
</div>
</form>
</body>
</html>

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

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

 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");
}
}
}
}

silverlight 用户浏览器未安装SL插件问题的更多相关文章

  1. 浏览器未安装flash插件,js判断直接去官网安装

    近期做了个活动页,里面根据需求插入了阿里云的视频,常见的浏览器都支持包括低版本的. 由于浏览器的更新换代很多版本放弃了flash的插件安装,火狐就是其中之一. 未安装flash的浏览器如果打开这个链接 ...

  2. js判断浏览器是否安装Flash插件,并提示安装或开启

    var flashChecker = function() { var hasFlash = 0; //是否安装了flash var flashVersion = 0; //flash版本 if(do ...

  3. adblockTester通过js检测用户浏览器是否安装了AdBlock

    adblockTester 简介 首先有必要介绍一下AdBlock,它是一款知名网页广告屏蔽插件,在各大主流浏览器上均有AdBlock插件. AdBlock为用户带来了一片蓝天,却苦了站长,尤其是苦逼 ...

  4. Postman Google浏览器离线安装Postman插件

    Google浏览器离线安装Postman插件 by:授客 QQ:1033553122 解决无法通打开谷歌web商店安装Postman插件的问题,文章参考网络. 测试环境:ChromeStandalon ...

  5. JS判断浏览器是否安装flash插件

    1.直接判断是否有flash插件 var myFlash = (function(){ if(typeof window.ActiveXObject != "undefined") ...

  6. 如何用js检查浏览器是否安装flash插件

    <script type="text/javascript" language="JavaScript"> //Powered By smvv @h ...

  7. 网页如何检查浏览器是否安装flash插件

    如果页面需要加载flash插件并且需要提示用户flash下载,这里有个官方很好的js文件只要引用就可以实现 //v1.7 // Flash Player Version Detection // De ...

  8. Chrome浏览器商店安装的插件保存到本地

    Chrome自67版本开始,不能从第三方下载插件拖动安装,要么就是以前的方法安装修改为zip格式,会有报错(报错如下图),强迫症肯定忍不了报错的:按照网上说法,是第三方插件的压缩算法和Chrome商店 ...

  9. Silverlight 用户代码未处理 TypeLoadException

    在Silverlight中动态创建Enum时,多次调用改方法出现上图所示错误,后来发现定义名称都是一样的, 在程序中声明全局变量去区别就可以了. int num = 1; private Type C ...

随机推荐

  1. FITS 基本格式及其扩展

    一.FITS 一般介绍二.FITS 的一般结构三.FITS 基本格式四.FITS 的随机组扩展五.FITS 的表扩展 (ASCII 表扩展)六.FITS 的一般扩展和块因子参考文献 FITS 基本格式 ...

  2. 编写一个简单的Jquery插件

    1.实现内容 定义一个简单的jquery插件,alert传递进来的参数 2.插件js文件(jquery.showplugin.js) (function ($) { //定义插件中的方法 var me ...

  3. Centos7升级gcc学习笔记

    概述 最近在学习<深入应用C++11-代码与优化与工程级应用>,我的gcc版本是gcc-4.8.5是支持C++11的,但是我在作者的github上看了一些C++例子,其中有些是C++14的 ...

  4. Windows 之 CMD命令

    1. ipconfig 查看 Windows IP 配置 2. ping IP地址 查看远程IP是否通畅 2. ipconfig/flushdns 刷新和重置缓存 3. netsh winsock r ...

  5. 下拉选择框加listview删除

    package com.downselect; import java.util.ArrayList; import android.R.array; import android.app.Activ ...

  6. 一、Android应用程序的基本原理(Fundamentals [,fʌndə'mentlz])

    Android 应用程序以java作为编程语言.Android SDK工具把代码连同数据.资源文件一起编译成一个以.apk为后缀(suffix)的android 程序存档(archive)文件包.在一 ...

  7. [转]SVN:This client is too old to work with working copy 的解决方案

    前一段时间,我在Eclipse碰到一个SVN错误,出现的原因是我的Eclipse的SVN插件是1.6,服务器的SVN版本是1.5.4,然后我在工程目录下做了一次提交操作(不是Eclipse里),到最后 ...

  8. remove all .git files and directories use one command

    find . -type d -name ".git" | xargs rm -rf

  9. ibatis mysql replace into 返回ID

    目前只能在replace into 之后,重新查询数据

  10. uclibc,eglibc,glibc之间的区别和联系

    http://bbs.chinaunix.net/thread-3762882-1-1.html 1.Glibc glibc = GNU C Library 是GNU项(GNU Project)目,所 ...