if (!isOK) {
var msgw, msg " /> 成人在线观看视频网站,一级aa免费视频毛片,老扒夜夜春宵粗大好爽aa毛片

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

SilverLight自動安裝

1、 準(zhǔn)備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 //提示窗口標(biāo)題高度
bordercolor = "#336699"; //提示窗口的邊框顏色
titlecolor = "#99CCFF"; //提示窗口的標(biāo)題顏色

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


//背景層(大小與窗口有效區(qū)域相同,即當(dāng)彈出對話框時,背景顯示為放射狀透明灰色)
var bgObj = document.createElement("div"); //創(chuàng)建一個div對象(背景層)
//定義div屬性,即相當(dāng)于
//<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內(nèi)添加該div對象


var msgObj = document.createElement("div")//創(chuàng)建一個div對象(提示框?qū)樱?/span>
//定義div屬性,即相當(dāng)于
//<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"); //創(chuàng)建一個h4對象(提示框標(biāo)題欄)

//定義h4的屬性,即相當(dāng)于
//<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="">關(guān)閉</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
= "關(guān)閉";


function removeObj() {//點(diǎn)擊標(biāo)題欄觸發(fā)的事件
document.body.removeChild(bgObj); //刪除背景層Div
document.getElementById("msgDiv").removeChild(title); //刪除提示框的標(biāo)題欄
document.body.removeChild(msgObj); //刪除提示框?qū)?/span>
}
title.onclick
= removeObj;


document.body.appendChild(msgObj);
//在body內(nèi)添加提示框div對象msgObj
document.getElementById("msgDiv").appendChild(title); //在提示框div中添加標(biāo)題欄對象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/">系統(tǒng)正在下載或者安裝此程序。或者 <a href=/"/" id=/"downLink/">點(diǎn)擊此處</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/">點(diǎn)擊此處</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技術(shù)SilverLight自動安裝,轉(zhuǎn)載需保留來源!

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

主站蜘蛛池模板: 欧美美女视频网站 | 99精品亚洲| 亚洲一区二区三区精品国产 | 欧美日韩亚洲国产精品一区二区 | 国产成人盗摄精品 | 国产区亚洲区 | 色哟哟哟 | 国产精品久久一区一区 | 国产小视频免费在线观看 | 在线视频一区二区三区在线播放 | 在线亚洲日产一区二区 | 久久亚洲精品成人 | 97精品国产91久久久久久久 | 国产第一亚洲 | 野战露脸在线视频国产 | 九九视频精品在线 | 国产精品久久久久999 | 亚洲精品xxxxx| 精品国产免费第一区二区 | 日韩视频在线一区 | 午夜一级 | 婷婷综合影院 | 欧美精品第一页 | 国产一区二区三区怡红院 | 怡红院成人影院 | 欧美成a人免费观看久久 | 久久久久久久久免费影院 | 久青草国产在线视频亚瑟影视 | 中文字幕久久久久 | 中文字幕1区2区 | 色视频在线免费观看 | 五月婷婷激情 | 亚洲香蕉久久综合网 | 青青热久久综合网伊人 | 伊人狼人久久 | 国产乱来视频 | 国产欧美日韩综合精品一区二区三区 | 337p亚洲精品色噜噜狠狠 | 国产久热香蕉在线观看 | 国产欧美精品专区一区二区 | 欧美激情二区 |