if (!isOK) {
var msgw, msg " /> 成人网18视频网站,深夜免费福利,欧美成国产精品

一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

SilverLight自動安裝

1、 準備js,參考了一個js彈出層的例子。最后自動輸出exe,類似flash安裝。ie可以自動安裝,其他瀏覽器需要手動下載安裝包。

 var isOK = Silverlight.isInstalled("4.0.50524.0");
if (!isOK) {
var msgw, msgh, bordercolor;
msgw
= 450; //提示窗口的寬度
msgh = 150; //提示窗口的高度
titleheight = 25 //提示窗口標題高度
bordercolor = "#336699"; //提示窗口的邊框顏色
titlecolor = "#99CCFF"; //提示窗口的標題顏色

var sWidth, sHeight;
sWidth
= document.body.offsetWidth; //瀏覽器工作區域內頁面寬度
sHeight = screen.height; //屏幕高度(垂直分辨率)


//背景層(大小與窗口有效區域相同,即當彈出對話框時,背景顯示為放射狀透明灰色)
var bgObj = document.createElement("div"); //創建一個div對象(背景層)
//定義div屬性,即相當于
//<div id="bgDiv" style="position:absolute; top:0; background-color:#777; filter:progid:DXImagesTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75); opacity:0.6; left:0; width:918px; height:768px; z-index:10000;"></div>
bgObj.setAttribute('id', 'bgDiv');
bgObj.style.position
= "absolute";
bgObj.style.top
= "0";
bgObj.style.background
= "#777";
bgObj.style.filter
= "progid:DXImageTransform.Microsoft.Alpha(style=2,opacity=25,finishOpacity=75";
bgObj.style.opacity
= "0.6";
bgObj.style.left
= "0";
bgObj.style.width
= sWidth + "px";
bgObj.style.height
= sHeight * 2 + "px";
bgObj.style.zIndex
= "10000";
document.body.appendChild(bgObj);
//在body內添加該div對象


var msgObj = document.createElement("div")//創建一個div對象(提示框層)
//定義div屬性,即相當于
//<div id="msgDiv" align="center" style="background-color:white; border:1px solid #336699; position:absolute; left:50%; top:50%; font:12px/1.6em Verdana,Geneva,Arial,Helvetica,sans-serif; margin-left:-225px; margin-top:npx; width:400px; height:100px; text-align:center; line-height:25px; z-index:100001;"></div>
msgObj.setAttribute("id", "msgDiv");
msgObj.setAttribute(
"align", "center");
msgObj.style.background
= "white";
msgObj.style.border
= "1px solid " + bordercolor;
msgObj.style.position
= "absolute";
msgObj.style.left
= "50%";
msgObj.style.top
= "20%";
msgObj.style.font
= "12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
msgObj.style.marginLeft
= "-225px";
msgObj.style.marginTop
= -75 + document.documentElement.scrollTop + "px";
msgObj.style.width
= msgw + "px";
msgObj.style.height
= msgh + "px";
msgObj.style.padding
= "0px";
msgObj.style.textAlign
= "center";
msgObj.style.lineHeight
= "25px";
msgObj.style.zIndex
= "10001";

var title = document.createElement("h4"); //創建一個h4對象(提示框標題欄)

//定義h4的屬性,即相當于
//<h4 id="msgTitle" align="right" style="margin:0; padding:3px; background-color:#336699; filter:progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100); opacity:0.75; border:1px solid #336699; height:18px; font:12px Verdana,Geneva,Arial,Helvetica,sans-serif; color:white; cursor:pointer;" onclick="">關閉</h4>
title.setAttribute("id", "msgTitle");
title.setAttribute(
"align", "right");
title.style.margin
= "0";
title.style.padding
= "3px";
title.style.background
= bordercolor;

title.style.filter
= "progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
title.style.opacity
= "0.75";
title.style.border
= "1px solid " + bordercolor;
title.style.height
= "18px";

title.style.font
= "12px Verdana, Geneva, Arial, Helvetica, sans-serif";

title.style.color
= "white";
title.style.cursor
= "pointer";
title.innerHTML
= "關閉";


function removeObj() {//點擊標題欄觸發的事件
document.body.removeChild(bgObj); //刪除背景層Div
document.getElementById("msgDiv").removeChild(title); //刪除提示框的標題欄
document.body.removeChild(msgObj); //刪除提示框層
}
title.onclick
= removeObj;


document.body.appendChild(msgObj);
//在body內添加提示框div對象msgObj
document.getElementById("msgDiv").appendChild(title); //在提示框div中添加標題欄對象title

var dv = document.createElement("div");
dv.setAttribute(
"id", "slInstall");
dv.setAttribute(
"style", "font-family:Arial; font-size:14px; ");
dv.innerHTML
= "<br />安裝Microsoft Silverlight后,才能正常瀏覽該頁面。<br /><span id=/"msgSpan/">系統正在下載或者安裝此程序。或者 <a href=/"/" id=/"downLink/">點擊此處</a> 手動安裝。</span><br />安裝完成后請重新啟動瀏覽器。";
document.getElementById(
"msgDiv").appendChild(dv); //在提示框div中添加提示信息對象txt

//輸出exe
var downHost = "改為你的地址 例如http://192.168.23.22:8008/download/";
var osInfo = window.navigator.userAgent;
var exeName = "";
if (osInfo.indexOf("Windows NT") >= 0) exeName = "Silverlight4forwindows.exe";
else if (osInfo.indexOf("PPC Mac OS X") >= 0) exeName = "Silverlight4formac.dmg";
else if (osInfo.indexOf("Intel Mac OS X") >= 0) exeName = "Silverlight4formac.dmg";
document.getElementById(
"downLink").href = downHost + exeName;


/*判斷瀏覽器*/
if (osInfo.indexOf("MSIE") == -1) {
document.getElementById(
"msgSpan").innerHTML = "您的瀏覽器不支持自動安裝Silverlight,請 <a href=/"/" style=/"text-decoration:underline/" id=/"downLink/">點擊此處</a> 手動安裝。";

}
else {
//輸出exe安裝包
run_exe = "<OBJECT ID=/"RUNIT/" WIDTH=0 HEIGHT=0 TYPE=/"application/x-oleobject/""
run_exe += "CODEBASE=/"{0}/">"
run_exe
+= "</OBJECT>"
run_exe
= run_exe.replace("{0}", downHost + exeName);
document.open();
document.clear();
document.writeln(run_exe);
document.close();
}

}

NET技術SilverLight自動安裝,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 一级做a爰片久久毛片16 | 久久精品亚洲精品国产色婷 | 国产色婷婷精品免费视频 | www.日韩.com| 亚洲国产成人久久一区www | 欧美另类极品videosbest视频 | 草草视频在线观看最新 | 亚洲视频福利 | 中文字幕在线永久在线视频2020 | 精品久久久中文字幕一区 | 精品九九九 | 中国一级特黄特色真人毛片 | 国产手机国产手机在线 | 国产区视频在线观看 | 丝袜精品 欧美 亚洲 自拍 | a级精品国产片在线观看 | 激情五月激情 | 91在线成人 | 3p久久| 色呦呦在线 | 中文字幕佐山爱一区二区免费 | 四虎在线视频免费观看视频 | 免费在线观看色 | 优优色影院 | 伊人中文在线 | 色综合天天综合网国产成人网 | 中文字幕在线亚洲 | 国产精品激情综合久久 | 国产精自产拍久久久久久 | 91手机在线 | 美女视频黄.免费网址 | 中文字幕av一区二区三区 | 美女色黄网站 | 高清在线亚洲精品国产二区 | 亚洲性小说 | 亚洲精品无码专区在线播放 | 视色4se影院在线播放 | 全国最大色成免费网站 | 视频精品一区二区三区 | 日韩美女视频一区 | 美女黄网站免费观看 |