java php net_网页快速入门(asp aps.net php java)
從我們網(wǎng)站首頁(yè)下載 最新安裝包,安裝包大概有150M,是個(gè)rar自解壓文件,里面包括了所有幫助文件、和所有語(yǔ)言調(diào)用的運(yùn)行例子,最終用戶使用發(fā)布包只有16M。界面如下:
下載CAD控件開發(fā)包,下載成功后安裝文件如下:
下載的文件是一個(gè)壓縮文件,雙擊解壓之后,以管理員身份運(yùn)行“ RegMxDrawX.bat ”注冊(cè)CAD控件到系統(tǒng)中,如果注冊(cè)失敗請(qǐng)退出360等殺毒軟件,再運(yùn)行RegMxDrawX.bat。界面如下:
控件注冊(cè)成功后,會(huì)彈出注冊(cè)成功彈框。界面如下:
控件是個(gè)ocx,Id為 74A777F8-7A8F-4e7c-AF47-7074828086E2
Html中引用控件需要添加代碼如下:
document.oncontextmenu?=?new?Function('event.returnValue=false;');?//禁用右鍵
function?LoadMxDrawX(id,dwgfile,cabpath,msipath)?{
var?s,?classid,?Sys?=?{},?ua?=?navigator.userAgent.toLowerCase();
(s?=?ua.match(/msie?([\d.]+)/))???Sys.ie?=?s[1]?:?(s?=?ua.match(/trident\/([\d.]+)/))???Sys.ie9?=?s[1]?:?(s?=?ua.match(/firefox\/([\d.]+)/))???Sys.firefox?=?s[1]?:?(s?=?ua.match(/chrome\/([\d.]+)/))???Sys.chrome?=?s[1]?:?(s?=?ua.match(/opera.([\d.]+)/))???Sys.opera?=?s[1]?:?(s?=?ua.match(/version\/([\d.]+).*safari/))???Sys.safari?=?s[1]?:?0,
classid?=?"74A777F8-7A8F-4e7c-AF47-7074828086E2",
Sys.ie?||?Sys.ie9???(document.write("???"),
document.write("???"),
document.write('
//document.write('width="85%"?height="85%"?align="left">???'),
document.write('codebase="?'?+?cabpath?+?'width="85%"?height="85%"?align="left">???'),
document.write('??'),
document.write('??'),
document.write('??'),
document.write(''),
document.write('?'),
document.write(''),
document.write('??'),
document.write('???'),
document.write('??'),
document.write(''),
document.write('??'),
document.write(''),
document.write(''),
document.write(''),
document.write(''),
document.write('不能裝載文檔控件。請(qǐng)?jiān)跈z查瀏覽器的選項(xiàng)中檢查瀏覽器的安全設(shè)置。請(qǐng)點(diǎn)擊安裝控件'),
document.write('
'))?:Sys.chrome???(document.write('
document.write('type="application/mxdraw-activex"?width="85%"?height="85%"?align="left">?'),
document.write('??'),
document.write('??'),
document.write('??'),
document.write(''),
document.write('?'),
document.write(''),
document.write('??'),
document.write('???'),
document.write('??'),
document.write(''),
document.write('??'),
document.write(''),
document.write(''),
document.write(''),
document.write(''),
document.write(''),
document.write('不能裝載文檔控件,谷歌瀏覽器使用,下載MxChrome安裝包到本地,安裝后點(diǎn)擊桌面?Chrome企業(yè)版?快捷方式啟動(dòng)。請(qǐng)點(diǎn)擊安裝控件'),
document.write('
'))?:Sys.firefox???(document.write("???"),
document.write("??"),
document.write('
不能裝載文檔控件。1.請(qǐng)?jiān)诎惭bieTab插件,2.然后請(qǐng)點(diǎn)擊安裝控件,?3.然后右鍵彈出菜單,點(diǎn)擊使用ieTab瀏覽??'))?:
Sys.opera???alert("sorry,ntko?暫時(shí)不支持opera!")?:
Sys.safari?&&?alert("sorry,ntko?暫時(shí)不支持safari!");
}
function?isFireFox()
{
var?s,?classid,?Sys?=?{},?ua?=?navigator.userAgent.toLowerCase();
(s?=?ua.match(/msie?([\d.]+)/))???Sys.ie?=?s[1]?:?(s?=?ua.match(/trident\/([\d.]+)/))???Sys.ie9?=?s[1]?:?(s?=?ua.match(/firefox\/([\d.]+)/))???Sys.firefox?=?s[1]?:?(s?=?ua.match(/chrome\/([\d.]+)/))???Sys.chrome?=?s[1]?:?(s?=?ua.match(/opera.([\d.]+)/))???Sys.opera?=?s[1]?:?(s?=?ua.match(/version\/([\d.]+).*safari/))???Sys.safari?=?s[1]?:?0;
return??Sys.firefox;
}
使用參考例子 samples\ie 引用CAD控件添加代碼如下:
標(biāo)記中各個(gè)部分的含義如下:
id=" MxDrawXCtrl "標(biāo)識(shí)控件的JavaScript編程標(biāo)識(shí),通過document.all("MxDrawXCtrl ")即可得到對(duì)控件對(duì)象的引用。
clsid: ?74A777F8-7A8F-4e7c-AF47-7074828086E2 標(biāo)識(shí)控件的唯一標(biāo)識(shí)。瀏覽器通過這個(gè)clsid來判斷訪問網(wǎng)頁(yè)的客戶機(jī)是否已經(jīng)安裝控件。
codebase="http://www.mxcad.net:2080/MxDrawX52.CAB#version=4.0.0.1"
在網(wǎng)頁(yè)上自動(dòng)安裝CAB包,http://www.mxcad.net:2080/MxDrawX52.CAB是CAB包在服務(wù)器上的位置。version=4.0.0.1是控件版本號(hào),如果這個(gè)版本號(hào)取的比文件屬性中版本號(hào)低,則不會(huì)在ie中自動(dòng)下載提示更新安裝,如果比文件屬性中的版本號(hào)高,則會(huì)總是提示更新安裝。
這個(gè)版本號(hào)可以查看 mxdrawx.ocx 文件的屬性得到,最新版已經(jīng)升級(jí)到version=9.0.0.1,界面如下:
參考例子目錄:src\MxDraw5.2\sample\ie
src\MxDraw5.2\sample\ie\iedemoTest.htm
src\MxDraw5.2\sample\JavaScript
總結(jié)
以上是生活随笔為你收集整理的java php net_网页快速入门(asp aps.net php java)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: pyqt 槽任意参数_PyQt5快速入门
- 下一篇: getoutputstream java