国产探花免费观看_亚洲丰满少妇自慰呻吟_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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 文昌市| 彭阳县| 樟树市| 松桃| 房产| 庐江县| 桂平市| 安达市| 安徽省| 新兴县| 永兴县| 丰镇市| 南京市| 阿城市| 灵武市| 富阳市| 平湖市| 南京市| 龙胜| 南溪县| 长岭县| 宁城县| 大邑县| 庐江县| 靖安县| 龙胜| 右玉县| 东源县| 印江| 六枝特区| 湖南省| 康平县| 法库县| 林州市| 芜湖县| 马尔康县| 吉木乃县| 桦南县| 新竹市| 忻城县| 寻乌县|