网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的考试资料:

 

标题 将VBS或ASP中的代码转成一句话形式
内容
    将VBS或ASP中的代码转成一句话形式 以前都以为直接把换行符换成冒号就可以了...
    结果发现,有TABLE不行
    类似if xx=1 then yy=2 的也不行...
    //此脚本支持拖放,也可以在命令行下使用 cscript change.vbs xx.asp
    代码如下:
    On Error Resume Next
    Set Arg=Wscript.Arguments
    If Arg.Count=0 Then wscript.quit
    'code by NetPatch
    'enjoy it
    Set Fso=CreateObject("Scripting.FileSystemObject")
    Set File=Fso.OpenTextFile(arg(0),1,False,-2)
    Set Files=Fso.OpenTextFile(arg(0)&".vbs",2,True)
    Do While File.AtEndOfStream <> True
    szBuf=File.readline
    szBuf=Replace(szBuf,chr(9),"")
    Findnum=InStr(LCase(szBuf),"then")
    If Findnum >0 Then
    Findnum=findnum+3
    If Len(szBuf) > Findnum Then
    szBuf=szBuf&":End If"
    End If
    End If
    Files.Write szBuf&":"
    Loop
    File.Close
    Files.Close
    Set Fso=Nothing
    Wscript.echo "ok!"
随便看

 

在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/20 12:32:01