home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / nivb_src / fse2x.frm < prev    next >
Text File  |  1993-06-03  |  7KB  |  212 lines

  1. VERSION 2.00
  2. Begin Form FSE2xForm 
  3.    Caption         =   "File Server Environment v2.x Services Test"
  4.    Height          =   4050
  5.    Left            =   1725
  6.    LinkTopic       =   "Form1"
  7.    ScaleHeight     =   3645
  8.    ScaleWidth      =   5385
  9.    Top             =   1485
  10.    Width           =   5505
  11.    Begin Frame Frame1 
  12.       Caption         =   "Disk Cache Statistics"
  13.       Height          =   1935
  14.       Left            =   120
  15.       TabIndex        =   5
  16.       Top             =   960
  17.       Width           =   5175
  18.       Begin Label CacheHitsLabel 
  19.          Height          =   255
  20.          Left            =   2640
  21.          TabIndex        =   17
  22.          Top             =   1560
  23.          Width           =   1695
  24.       End
  25.       Begin Label CacheWritesLabel 
  26.          Height          =   255
  27.          Left            =   2640
  28.          TabIndex        =   16
  29.          Top             =   1320
  30.          Width           =   1695
  31.       End
  32.       Begin Label CacheReadsLabel 
  33.          Height          =   255
  34.          Left            =   2640
  35.          TabIndex        =   15
  36.          Top             =   1080
  37.          Width           =   1695
  38.       End
  39.       Begin Label DirtyCacheLabel 
  40.          Height          =   255
  41.          Left            =   2640
  42.          TabIndex        =   14
  43.          Top             =   840
  44.          Width           =   1695
  45.       End
  46.       Begin Label CacheSizeLabel 
  47.          Height          =   255
  48.          Left            =   2640
  49.          TabIndex        =   13
  50.          Top             =   600
  51.          Width           =   1695
  52.       End
  53.       Begin Label CacheBuffLabel 
  54.          Height          =   255
  55.          Left            =   2640
  56.          TabIndex        =   12
  57.          Top             =   360
  58.          Width           =   1695
  59.       End
  60.       Begin Label Label8 
  61.          Alignment       =   1  'Right Justify
  62.          Caption         =   "Cache hits:"
  63.          Height          =   255
  64.          Left            =   480
  65.          TabIndex        =   11
  66.          Top             =   1560
  67.          Width           =   1695
  68.       End
  69.       Begin Label Label7 
  70.          Alignment       =   1  'Right Justify
  71.          Caption         =   "Cache writes:"
  72.          Height          =   255
  73.          Left            =   480
  74.          TabIndex        =   10
  75.          Top             =   1320
  76.          Width           =   1695
  77.       End
  78.       Begin Label Label6 
  79.          Alignment       =   1  'Right Justify
  80.          Caption         =   "Cache reads:"
  81.          Height          =   255
  82.          Left            =   480
  83.          TabIndex        =   9
  84.          Top             =   1080
  85.          Width           =   1695
  86.       End
  87.       Begin Label Label5 
  88.          Alignment       =   1  'Right Justify
  89.          Caption         =   "Dirty cache buffers:"
  90.          Height          =   255
  91.          Left            =   480
  92.          TabIndex        =   8
  93.          Top             =   840
  94.          Width           =   1695
  95.       End
  96.       Begin Label Label4 
  97.          Alignment       =   1  'Right Justify
  98.          Caption         =   "Cache buffer size:"
  99.          Height          =   255
  100.          Left            =   480
  101.          TabIndex        =   7
  102.          Top             =   600
  103.          Width           =   1695
  104.       End
  105.       Begin Label Label3 
  106.          Alignment       =   1  'Right Justify
  107.          Caption         =   "Cache buffers:"
  108.          Height          =   255
  109.          Left            =   480
  110.          TabIndex        =   6
  111.          Top             =   360
  112.          Width           =   1695
  113.       End
  114.    End
  115.    Begin CommandButton CancelButton 
  116.       Caption         =   "&Cancel"
  117.       Height          =   375
  118.       Left            =   2880
  119.       TabIndex        =   4
  120.       Top             =   3120
  121.       Width           =   975
  122.    End
  123.    Begin ComboBox ServerNameBox 
  124.       Height          =   300
  125.       Left            =   1680
  126.       TabIndex        =   1
  127.       Top             =   480
  128.       Width           =   2655
  129.    End
  130.    Begin CommandButton OKButton 
  131.       Caption         =   "&OK"
  132.       Height          =   375
  133.       Left            =   1560
  134.       TabIndex        =   0
  135.       Top             =   3120
  136.       Width           =   975
  137.    End
  138.    Begin Label Label2 
  139.       Caption         =   "Select a NetWare 2.x file server:"
  140.       Height          =   255
  141.       Left            =   120
  142.       TabIndex        =   3
  143.       Top             =   120
  144.       Width           =   4695
  145.    End
  146.    Begin Label Label1 
  147.       Alignment       =   1  'Right Justify
  148.       Caption         =   "File Server:"
  149.       Height          =   255
  150.       Left            =   120
  151.       TabIndex        =   2
  152.       Top             =   480
  153.       Width           =   1455
  154.    End
  155. End
  156.  
  157. Sub CancelButton_Click ()
  158.     Unload FSE2xForm
  159. End Sub
  160.  
  161. Sub Form_Load ()
  162.     Dim fileServerName As String * 48
  163.  
  164.     fileServerName = GetDefaultFileServerName()
  165.     ServerNameBox.Text = fileServerName
  166.     
  167.     For connID% = 1 To 8
  168.         If (IsConnectionIDInUse(connID%) = 1) Then
  169.             GetFileServerName connID%, fileServerName
  170.             ServerNameBox.AddItem fileServerName
  171.         End If
  172.     Next connID%
  173. End Sub
  174.  
  175. Sub Form_Unload (Cancel As Integer)
  176.     SetPreferredConnectionID (originalPrefConnID%)
  177. End Sub
  178.  
  179. Sub OKButton_Click ()
  180.     Dim cacheStats As DISK_CACHE_STATS
  181.  
  182.     connID% = GetPreferredConnectionID()
  183.     ccode% = CheckConsolePrivileges()
  184.     If (ccode% = SUCCESSFUL) Then
  185.         ccode% = GetDiskCacheStats(connID%, Len(cacheStats), cacheStats)
  186.         If (ccode% <> SUCCESSFUL) Then
  187.             MsgBox "Unable to get disk cache statistics.", MB_OK, "Error"
  188.         Else
  189.             CacheBuffLabel.Caption = Str$(cacheStats.cacheBufferCount)
  190.             CacheSizeLabel.Caption = Str$(cacheStats.cacheBufferSize)
  191.             DirtyCacheLabel.Caption = Str$(cacheStats.dirtyCacheBuffers)
  192.             CacheReadsLabel.Caption = Str$(cacheStats.cacheReadRequests)
  193.             CacheWritesLabel.Caption = Str$(cacheStats.cacheWriteRequests)
  194.             CacheHitsLabel.Caption = Str$(cacheStats.cacheHits)
  195.         End If
  196.     End If
  197. End Sub
  198.  
  199. Sub ServerNameBox_Change ()
  200.     ccode% = GetConnectionID(ServerNameBox.Text, connID%)
  201.     If (ccode% <> SUCCESSFUL) Then
  202.         MsgBox "Unable to get connection ID", MB_OK, "Error"
  203.     Else
  204.         SetPreferredConnectionID (connID%)
  205.     End If
  206. End Sub
  207.  
  208. Sub ServerNameBox_Click ()
  209.     ServerNameBox_Change
  210. End Sub
  211.  
  212.