home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / nivb / dllvers.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-07  |  2.3 KB  |  79 lines

  1. VERSION 2.00
  2. Begin Form DLLVersionForm 
  3.    Caption         =   "DLLVersions"
  4.    ClientHeight    =   1815
  5.    ClientLeft      =   3135
  6.    ClientTop       =   1590
  7.    ClientWidth     =   2775
  8.    Height          =   2220
  9.    Left            =   3075
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form2"
  12.    ScaleHeight     =   1815
  13.    ScaleWidth      =   2775
  14.    Top             =   1245
  15.    Width           =   2895
  16.    Begin CommandButton OKButton 
  17.       Caption         =   "OK"
  18.       Height          =   375
  19.       Left            =   1080
  20.       TabIndex        =   0
  21.       Top             =   1320
  22.       Width           =   735
  23.    End
  24.    Begin Label Label3 
  25.       Alignment       =   2  'Center
  26.       Height          =   255
  27.       Left            =   120
  28.       TabIndex        =   3
  29.       Top             =   960
  30.       Width           =   2535
  31.    End
  32.    Begin Label Label2 
  33.       Alignment       =   2  'Center
  34.       Height          =   255
  35.       Left            =   120
  36.       TabIndex        =   2
  37.       Top             =   600
  38.       Width           =   2535
  39.    End
  40.    Begin Label Label1 
  41.       Alignment       =   2  'Center
  42.       Height          =   255
  43.       Left            =   120
  44.       TabIndex        =   1
  45.       Top             =   240
  46.       Width           =   2535
  47.    End
  48. Sub Form_Load ()
  49.     Label1.Caption = GetDLLVersion("NWNETAPI.DLL")
  50.     Label2.Caption = GetDLLVersion("NWIPXSPX.DLL")
  51.     Label3.Caption = GetDLLVersion("NWPSERV.DLL")
  52. End Sub
  53. Function GetDLLVersion (DLLFileName$) As String
  54.     winDir$ = Environ$("windir")
  55.     DLLFile$ = winDir$ + "\" + DLLFileName$
  56.     fileFound$ = Dir$(DLLFile$)
  57.     If (Len(fileFound$) = 0) Then
  58.         GetDLLVersion = DLLFileName$ + " not found"
  59.     Else
  60.         Open DLLFile$ For Binary Access Read Shared As #1
  61.         Do While Not EOF(1)
  62.             buffer$ = Input$(8, #1)
  63.             If (buffer$ = "VeRsIoN=") Then
  64.                 Do
  65.                     char$ = Input$(1, #1)
  66.                     version$ = version$ + char$
  67.                 Loop While (char$ <> Chr$(0))
  68.                 GoTo Break
  69.             End If
  70.         Loop
  71. Break:
  72.         Close
  73.     End If
  74.     GetDLLVersion = version$
  75. End Function
  76. Sub OKButton_Click ()
  77.     Unload DLLVersionForm
  78. End Sub
  79.