国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > IIS > 正文

清空iis log 中自己登錄ip的vbs(僅供研究使用)

2024-08-29 03:13:53
字體:
來源:轉載
供稿:網友
注冊會員,創建你的web開發資料庫,option explicit

dim sourcefile,ipaddress,objargs

const destfile="tempfile"
const forwriting = 2

dim text
dim fso,objnet,serviceobj
dim txtstream, txtstreamout

set objargs = wscript.arguments         
if objargs.count = 2 then               
    sourcefile=objargs(0)
    ipaddress=objargs(1)
else
    wscript.echo "parameter error"+ vbcrlf
    wscript.echo "usage:killlog.vbs logfilename yourip."
    wscript.quit 1
end if


set fso = createobject("scripting.filesystemobject")
if fso.fileexists (sourcefile) then
    set objnet = wscript.createobject( "wscript.network" )
    set serviceobj = getobject("winnt://" & objnet.computername & "/w3svc")
    set objnet=nothing
    serviceobj.stop
    wscript.sleep 6000
    set txtstream = fso.opentextfile(sourcefile)
    set txtstreamout = fso.opentextfile(destfile, forwriting, true)
    do while not (txtstream.atendofstream)  
        text = txtstream.readline           
        if instr(text,ipaddress)=0 then
            txtstreamout.writeline text     
        end if
    loop

    set txtstream = nothing                 
    set txtstreamout = nothing

    wscript.echo "the log file-- " & sourcefile &" has cleaned your ip!"
else
    wscript.echo "the log file-- " & sourcefile & " has not found!"
    wscript.quit
end if
fso.copyfile destfile, sourcefile
fso.deletefile destfile
set fso=nothing
serviceobj.start
set serviceobj = nothing

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 濮阳县| 仙桃市| 安泽县| 定兴县| 盱眙县| 铜川市| 富宁县| 武陟县| 淮阳县| 改则县| 建瓯市| 什邡市| 徐州市| 含山县| 宁都县| 玉山县| 湘阴县| 分宜县| 扶余县| 徐水县| 灌阳县| 无锡市| 韶关市| 格尔木市| 中牟县| 凉山| 芜湖县| 浦县| 浏阳市| 镇坪县| 丰宁| 黄大仙区| 洞头县| 沙河市| 武强县| 鱼台县| 肥城市| 罗定市| 时尚| 教育| 信丰县|