home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / free_security / languard / languardnss7.exe / helper.vbs < prev    next >
Encoding:
Text File  |  2005-10-04  |  1.6 KB  |  67 lines

  1. Dim cr As String
  2. cr = Chr(13) + Chr(10)
  3.  
  4. Function LNSSPath
  5.     Dim RegObject As Object
  6.     Dim Path As String
  7.     Set RegObject = Registry.Connect("127.0.0.1")
  8.     Path = RegObject.Read("SOFTWARE\GFI\LNSS7", "Path")
  9.     LNSSPath = Path
  10. End Function
  11.  
  12. Function RegExpTest(Pattern, Text)
  13.       Dim RegExp As Object
  14.     Set RegExp = CreateObject("Vbscript.RegExp")        
  15.     RegExp.Pattern = pattern         
  16.     RegExp.IgnoreCase = True      
  17.     RegExpTest = RegExp.Test(Text)    
  18. End Function    
  19.  
  20. Function getbanner(ip,port,request)
  21.     Dim SockObject As Object
  22.     Set SockObject  = Socket.Opentcp(Ip,Port)
  23.     If Not SockObject is Nothing Then 
  24.         If Not (IsEmpty(request)) Then
  25.             request = request
  26.             SockObject.send request            
  27.         End If
  28.         strResponse = SockObject.recv(1024)
  29.            SockObject.close
  30.     End If
  31.     getbanner = strResponse
  32.     
  33. End Function 
  34.  
  35. Function GetEnviron(Path)
  36.     Dim Wsh As Object
  37.        Dim objEnv As Object
  38.        Set Wsh = CreateObject("WScript.Shell")
  39.        Set objEnv = Wsh.Environment("Process")
  40.     GetEnviron = objEnv(Path)
  41. End Function
  42.  
  43. Function Fileexists(filename)
  44.     Dim FileObject As Object
  45.     Dim result As Boolean
  46.     result = false
  47.     Set FileObject = File.Connect("127.0.0.1")
  48.     If FileObject.open(filename, GENERIC_READ, OPEN_EXISTING) Then
  49.         FileObject.Close
  50.         result = true
  51.     End If
  52.     Fileexists = result
  53. End Function
  54.  
  55. Function Remote_Fileexists(ip,filename)
  56.     Dim FileObject As Object
  57.     Dim result As Boolean
  58.     result = false
  59.     Set FileObject = File.Connect(ip)
  60.     If FileObject.open(filename, GENERIC_READ, OPEN_EXISTING) Then
  61.         FileObject.Close
  62.         result = true
  63.     End If
  64.     remote_Fileexists = result
  65. End Function
  66.  
  67.