java php net_网页快速入门(asp aps.net php java)
從我們網站首頁下載 最新安裝包,安裝包大概有150M,是個rar自解壓文件,里面包括了所有幫助文件、和所有語言調用的運行例子,最終用戶使用發布包只有16M。界面如下:
下載CAD控件開發包,下載成功后安裝文件如下:
下載的文件是一個壓縮文件,雙擊解壓之后,以管理員身份運行“ RegMxDrawX.bat ”注冊CAD控件到系統中,如果注冊失敗請退出360等殺毒軟件,再運行RegMxDrawX.bat。界面如下:
控件注冊成功后,會彈出注冊成功彈框。界面如下:
控件是個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('不能裝載文檔控件。請在檢查瀏覽器的選項中檢查瀏覽器的安全設置。請點擊安裝控件'),
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安裝包到本地,安裝后點擊桌面?Chrome企業版?快捷方式啟動。請點擊安裝控件'),
document.write('
'))?:Sys.firefox???(document.write("???"),
document.write("??"),
document.write('
不能裝載文檔控件。1.請在安裝ieTab插件,2.然后請點擊安裝控件,?3.然后右鍵彈出菜單,點擊使用ieTab瀏覽??'))?:
Sys.opera???alert("sorry,ntko?暫時不支持opera!")?:
Sys.safari?&&?alert("sorry,ntko?暫時不支持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控件添加代碼如下:
標記中各個部分的含義如下:
id=" MxDrawXCtrl "標識控件的JavaScript編程標識,通過document.all("MxDrawXCtrl ")即可得到對控件對象的引用。
clsid: ?74A777F8-7A8F-4e7c-AF47-7074828086E2 標識控件的唯一標識。瀏覽器通過這個clsid來判斷訪問網頁的客戶機是否已經安裝控件。
codebase="http://www.mxcad.net:2080/MxDrawX52.CAB#version=4.0.0.1"
在網頁上自動安裝CAB包,http://www.mxcad.net:2080/MxDrawX52.CAB是CAB包在服務器上的位置。version=4.0.0.1是控件版本號,如果這個版本號取的比文件屬性中版本號低,則不會在ie中自動下載提示更新安裝,如果比文件屬性中的版本號高,則會總是提示更新安裝。
這個版本號可以查看 mxdrawx.ocx 文件的屬性得到,最新版已經升級到version=9.0.0.1,界面如下:
參考例子目錄:src\MxDraw5.2\sample\ie
src\MxDraw5.2\sample\ie\iedemoTest.htm
src\MxDraw5.2\sample\JavaScript
總結
以上是生活随笔為你收集整理的java php net_网页快速入门(asp aps.net php java)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: pyqt 槽任意参数_PyQt5快速入门
- 下一篇: php面试基础项目,PHP面试经典题