home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / nivb_src / wse.frm < prev   
Text File  |  1993-06-02  |  6KB  |  189 lines

  1. VERSION 2.00
  2. Begin Form WSEForm 
  3.    Caption         =   "Workstation Environment Services Test"
  4.    Height          =   4020
  5.    Left            =   1635
  6.    LinkTopic       =   "Form1"
  7.    ScaleHeight     =   3615
  8.    ScaleWidth      =   5370
  9.    Top             =   1200
  10.    Width           =   5490
  11.    Begin CommandButton DoneButton 
  12.       Caption         =   "&OK"
  13.       Height          =   372
  14.       Left            =   2280
  15.       TabIndex        =   0
  16.       Top             =   3120
  17.       Width           =   852
  18.    End
  19.    Begin Label ShortHwTypeLabel 
  20.       Height          =   252
  21.       Left            =   2520
  22.       TabIndex        =   15
  23.       Top             =   2400
  24.       Width           =   1812
  25.    End
  26.    Begin Label HwTypeLabel 
  27.       Height          =   252
  28.       Left            =   2520
  29.       TabIndex        =   14
  30.       Top             =   2160
  31.       Width           =   1812
  32.    End
  33.    Begin Label osVerLabel 
  34.       Height          =   252
  35.       Left            =   2520
  36.       TabIndex        =   13
  37.       Top             =   1920
  38.       Width           =   1812
  39.    End
  40.    Begin Label LocalDriveLabel 
  41.       Height          =   252
  42.       Left            =   2520
  43.       TabIndex        =   12
  44.       Top             =   2760
  45.       Width           =   972
  46.    End
  47.    Begin Label OSTypeLabel 
  48.       Height          =   252
  49.       Left            =   2520
  50.       TabIndex        =   11
  51.       Top             =   1680
  52.       Width           =   1812
  53.    End
  54.    Begin Label ShellVerLabel 
  55.       Height          =   252
  56.       Left            =   2520
  57.       TabIndex        =   10
  58.       Top             =   1200
  59.       Width           =   972
  60.    End
  61.    Begin Label PrimaryLabel 
  62.       Height          =   252
  63.       Left            =   2520
  64.       TabIndex        =   9
  65.       Top             =   720
  66.       Width           =   2532
  67.    End
  68.    Begin Label PreferredLabel 
  69.       Height          =   252
  70.       Left            =   2520
  71.       TabIndex        =   8
  72.       Top             =   480
  73.       Width           =   2532
  74.    End
  75.    Begin Label DefaultLabel 
  76.       Height          =   252
  77.       Left            =   2520
  78.       TabIndex        =   7
  79.       Top             =   240
  80.       Width           =   2532
  81.    End
  82.    Begin Label Label6 
  83.       Alignment       =   1  'Right Justify
  84.       Caption         =   "Workstation Environment description strings:"
  85.       Height          =   372
  86.       Left            =   240
  87.       TabIndex        =   6
  88.       Top             =   1560
  89.       Width           =   2172
  90.    End
  91.    Begin Label Label5 
  92.       Alignment       =   1  'Right Justify
  93.       Caption         =   "NetWare Shell version:"
  94.       Height          =   255
  95.       Left            =   240
  96.       TabIndex        =   5
  97.       Top             =   1200
  98.       Width           =   2175
  99.    End
  100.    Begin Label Label4 
  101.       Alignment       =   1  'Right Justify
  102.       Caption         =   "Number of Local Drives:"
  103.       Height          =   255
  104.       Left            =   240
  105.       TabIndex        =   4
  106.       Top             =   2760
  107.       Width           =   2175
  108.    End
  109.    Begin Label Label3 
  110.       Alignment       =   1  'Right Justify
  111.       Caption         =   "Primary connection ID:"
  112.       Height          =   255
  113.       Left            =   360
  114.       TabIndex        =   3
  115.       Top             =   720
  116.       Width           =   2055
  117.    End
  118.    Begin Label Label2 
  119.       Alignment       =   1  'Right Justify
  120.       Caption         =   "Preferred connection ID:"
  121.       Height          =   255
  122.       Left            =   240
  123.       TabIndex        =   2
  124.       Top             =   480
  125.       Width           =   2175
  126.    End
  127.    Begin Label Label1 
  128.       Alignment       =   1  'Right Justify
  129.       Caption         =   "Default connection ID:"
  130.       Height          =   255
  131.       Left            =   240
  132.       TabIndex        =   1
  133.       Top             =   240
  134.       Width           =   2175
  135.    End
  136. End
  137. Sub DoneButton_Click ()
  138.     Unload WSEForm
  139. End Sub
  140.  
  141. Sub Form_Load ()
  142.     Dim osType As String * 10
  143.     Dim osVer As String * 10
  144.     Dim hwType As String * 10
  145.     Dim shortHwType As String * 10
  146.  
  147.     fileServerName$ = String$(48, 0)
  148.     fileServerName$ = GetDefaultFileServerName()
  149.     fileServerName$ = Left$(fileServerName$, InStr(fileServerName$, Chr$(0)) - 1)
  150.     DefaultLabel.Caption = Format$(defaultConnID%) + "    (" + fileServerName$ + ")"
  151.     
  152.     fileServerName$ = String$(48, 0)
  153.     preferredConnID% = GetPreferredConnectionID()
  154.     If (preferredConnID% <> 0) Then
  155.         GetFileServerName preferredConnID%, fileServerName$
  156.         fileServerName$ = Left$(fileServerName$, InStr(fileServerName$, Chr$(0)) - 1)
  157.         PreferredLabel.Caption = Format$(preferredConnID%) + "    (" + fileServerName$ + ")"
  158.     Else
  159.         PreferredLabel.Caption = "Not set"
  160.     End If
  161.     
  162.     fileServerName$ = String$(48, 0)
  163.     primaryConnID% = GetPrimaryConnectionID()
  164.     If (primaryConnID% <> 0) Then
  165.         GetFileServerName primaryConnID%, fileServerName$
  166.         fileServerName$ = Left$(fileServerName$, InStr(fileServerName$, Chr$(0)) - 1)
  167.         PrimaryLabel.Caption = Format$(primaryConnID%) + "    (" + fileServerName$ + ")"
  168.     Else
  169.         PrimaryLabel.Caption = "Not set"
  170.     End If
  171.     
  172.     ccode% = GetNetWareShellVersion(majorVersion%, minorVersion%, revLevel%)
  173.     If (ccode% = 255) Then
  174.         ShellVerLabel.Caption = Format$(majorVersion%) + "." + Format$(minorVersion%) + Chr$(revLevel% + 97)
  175.     Else
  176.         ShellVerLabel.Caption = "Ancient"
  177.     End If
  178.  
  179.     numDrives% = GetNumberOfLocalDrives()
  180.     LocalDriveLabel.Caption = Format$(numDrives%)
  181.  
  182.     GetWorkstationEnvironment ByVal osType, ByVal osVer, ByVal hwType, ByVal shortHwType
  183.     OsTypeLabel.Caption = osType
  184.     OsVerLabel.Caption = osVer
  185.     HwTypeLabel.Caption = hwType
  186.     ShortHwTypeLabel = shortHwType
  187. End Sub
  188.  
  189.