zoukankan      html  css  js  c++  java
  • 使用vbs脚本检查网站是否使用asp.net

    Const AspNetExt="aspx"
    Dim Obj,Fso,F,Val,i
    Set Obj=New IISClass
    Set Fso=CreateObject("Scripting.FileSystemObject")
    Set F = Fso.CreateTextFile("是否有Net程序.txt", True)
    Obj.GetIIS
    i=0
    For Each Val In Obj.Site
     i=i+1
     WScript.Echo Fill(i,4) & "正在检测站点 " & Val.Name & " 是否有" & AspNetExt & "文件:"
     Path=Val.Path
     If CheckAspNet(Path) Then
      WScript.Echo vbTab & "有"
      F.WriteLine Fill(Val.Name,25) & Path
     Else
      WScript.Echo vbTab & "没有"
     End If
    Next
    F.Close()
    Set Fso=Nothing
    Set Obj=Nothing
    Function CheckAspNet(ByRef Path)
     Dim F,Folder,Files,fName,ExtName,dPath
     Dim Fso
     Set Fso=CreateObject("Scripting.FileSystemObject")
     Set F=Fso.GetFolder(Path)
     CheckAspNet=False
     For Each Files In F.Files
      fName=Files.Name
      ExtName=Fso.GetExtensionName(Path & "\" & fName)
      If LCase(ExtName)=LCase(AspNetExt) Then
       CheckAspNet=True
       Exit Function
      End If
     Next
     For Each Folder In F.SubFolders
      dPath=Path & "\" & Folder.Name
      If CheckAspNet(dPath) Then
       CheckAspNet=True
       Exit Function
      End If
     Next
     Set F=Nothing
     Set Fso=Nothing
    End Function

    Function Fill(byRef Str,byRef L)
     Dim Tmp
     If CLng(L)<=Len(Str) Then
      Fill=Str
      Exit Function
     End If
     Tmp=Str & Space(L)
     Fill=Left(Tmp,L)
    End Function
  • 相关阅读:
    右键点击属性截图不了
    win7再分配磁盘新加卷
    oracle逻辑存储结构
    ORACLE spool打印
    oracle实例状态
    基于SCN增量恢复DG同步
    delete误删数据使用SCN恢复
    DG中模拟failover故障与恢复
    NFS挂载遇到的问题
    关于“身为父母”
  • 原文地址:https://www.cnblogs.com/bluecobra/p/2465413.html
Copyright © 2011-2022 走看看