home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_1 / NIVB_SRC / DIAG.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-06-03  |  5.0 KB  |  138 lines

  1. VERSION 2.00
  2. Begin Form DiagForm 
  3.    Caption         =   "Diagnostics Services Test"
  4.    Height          =   2190
  5.    Left            =   2100
  6.    LinkMode        =   1  'Source
  7.    LinkTopic       =   "Form1"
  8.    ScaleHeight     =   1785
  9.    ScaleWidth      =   4680
  10.    Top             =   1230
  11.    Width           =   4800
  12.    Begin CommandButton OKButton 
  13.       Caption         =   "&OK"
  14.       Height          =   372
  15.       Left            =   1920
  16.       TabIndex        =   0
  17.       Top             =   1320
  18.       Width           =   852
  19.    End
  20.    Begin Label shellVerLabel 
  21.       Height          =   255
  22.       Left            =   3600
  23.       TabIndex        =   3
  24.       Top             =   960
  25.       Width           =   855
  26.    End
  27.    Begin Label Label4 
  28.       Alignment       =   1  'Right Justify
  29.       Caption         =   "You are running NetWare shell version:"
  30.       Height          =   255
  31.       Left            =   120
  32.       TabIndex        =   7
  33.       Top             =   960
  34.       Width           =   3375
  35.    End
  36.    Begin Label SPXVerLabel 
  37.       Height          =   255
  38.       Left            =   3600
  39.       TabIndex        =   8
  40.       Top             =   720
  41.       Width           =   855
  42.    End
  43.    Begin Label Label3 
  44.       Alignment       =   1  'Right Justify
  45.       Caption         =   "You are running SPX version:"
  46.       Height          =   255
  47.       Left            =   840
  48.       TabIndex        =   6
  49.       Top             =   720
  50.       Width           =   2655
  51.    End
  52.    Begin Label IPXVerLabel 
  53.       Height          =   255
  54.       Left            =   3600
  55.       TabIndex        =   2
  56.       Top             =   480
  57.       Width           =   855
  58.    End
  59.    Begin Label Label2 
  60.       Alignment       =   1  'Right Justify
  61.       Caption         =   "You are running IPX version:"
  62.       Height          =   255
  63.       Left            =   840
  64.       TabIndex        =   5
  65.       Top             =   480
  66.       Width           =   2655
  67.    End
  68.    Begin Label connNumLabel 
  69.       Height          =   255
  70.       Left            =   3600
  71.       TabIndex        =   1
  72.       Top             =   240
  73.       Width           =   855
  74.    End
  75.    Begin Label Label1 
  76.       Alignment       =   1  'Right Justify
  77.       Caption         =   "You are at connection:"
  78.       Height          =   255
  79.       Left            =   1440
  80.       TabIndex        =   4
  81.       Top             =   240
  82.       Width           =   2055
  83.    End
  84. Sub Form_Load ()
  85.     Dim physNodeAddress As NodeAddress
  86.     Dim socketNum As Integer
  87.     Dim destination As BeginDiagnosticStruct
  88.     Dim compList As ComponentList
  89.     Dim response As AllResponseData
  90.     Dim ipxResponse As IPXSPXVersion
  91.     Dim shellResponse As ShellVersionStruct
  92.     connNum& = GetConnectionNumber()
  93.     connNumLabel.Caption = Str$(connNum&)
  94.     ccode% = GetInternetAddress(connNum&, networkNum&, physNodeAddress, socketNum)
  95.     If (ccode% <> SUCCESSFUL) Then
  96.         MsgBox "Unable to get your workstation's internetwork address", MB_OK, "Error"
  97.     Else
  98.         destination.network = networkNum&
  99.         'destination.nodeAddr = physNodeAddress
  100.         destination.nodeAddr.nodeHi = physNodeAddress.nodeHi
  101.         destination.nodeAddr.nodeLo = physNodeAddress.nodeLo
  102.         destination.socket = socketNum
  103.         ccode% = BeginDiagnostics(destination, connID%, compList)
  104.         
  105.         If (ccode% <> SUCCESSFUL) Then
  106.             MsgBox "Your workstation is not responding to diagnostics request", MB_OK, "Error"
  107.         Else
  108.             offset% = FindComponentOffset(compList, IPX_SPX_COMPONENT)
  109.             ccode% = GetIPXSPXVersion(connID%, offset%, response, ipxResponse)
  110.             If (ccode% = SUCCESSFUL) Then
  111.                 IPXVerLabel.Caption = Format$(Asc(ipxResponse.IPXMajorVersion)) + "." + Format$(Asc(ipxResponse.IPXMinorVersion))
  112.                 SPXVerLabel.Caption = Format$(Asc(ipxResponse.SPXMajorVersion)) + "." + Format$(Asc(ipxResponse.SPXMinorVersion))
  113.             
  114.                 offset% = FindComponentOffset(compList, SHELL_COMPONENT)
  115.                 ccode% = GetShellVersionInfo(connID%, offset%, response, shellResponse)
  116.                 If (ccode% = SUCCESSFUL) Then
  117.                     shellVerLabel.Caption = Format$(Asc(shellResponse.major)) + "." + Format$(Asc(shellResponse.minor)) + Chr$(Asc(shellResponse.rev) + 97)
  118.                 Else
  119.                     shellVerLabel.Caption = "Unknown"
  120.                 End If
  121.             
  122.                 ccode% = EndDiagnostics(connID%)
  123.                 If (ccode% <> SUCCESSFUL) Then
  124.                     MsgBox "Your workstation is not responding to diagnostics request", MB_OK, "Error"
  125.                 End If
  126.             Else
  127.                 MsgBox "Your workstation is not responding to diagnostics request", MB_OK, "Error"
  128.                 IPXVerLabel.Caption = "Unknown"
  129.                 SPXVerLabel.Caption = "Unknown"
  130.                 shellVerLabel.Caption = "Unknown"
  131.             End If
  132.         End If
  133.     End If
  134. End Sub
  135. Sub OKButton_Click ()
  136.     Unload DiagForm
  137. End Sub
  138.