home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_1 / NIVB_SRC / FSE2X.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-06-03  |  6.4 KB  |  201 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. Sub CancelButton_Click ()
  156.     Unload FSE2xForm
  157. End Sub
  158. Sub Form_Load ()
  159.     Dim fileServerName As String * 48
  160.     fileServerName = GetDefaultFileServerName()
  161.     ServerNameBox.Text = fileServerName
  162.     For connID% = 1 To 8
  163.         If (IsConnectionIDInUse(connID%) = 1) Then
  164.             GetFileServerName connID%, fileServerName
  165.             ServerNameBox.AddItem fileServerName
  166.         End If
  167.     Next connID%
  168. End Sub
  169. Sub Form_Unload (Cancel As Integer)
  170.     SetPreferredConnectionID (originalPrefConnID%)
  171. End Sub
  172. Sub OKButton_Click ()
  173.     Dim cacheStats As DISK_CACHE_STATS
  174.     connID% = GetPreferredConnectionID()
  175.     ccode% = CheckConsolePrivileges()
  176.     If (ccode% = SUCCESSFUL) Then
  177.         ccode% = GetDiskCacheStats(connID%, Len(cacheStats), cacheStats)
  178.         If (ccode% <> SUCCESSFUL) Then
  179.             MsgBox "Unable to get disk cache statistics.", MB_OK, "Error"
  180.         Else
  181.             CacheBuffLabel.Caption = Str$(cacheStats.cacheBufferCount)
  182.             CacheSizeLabel.Caption = Str$(cacheStats.cacheBufferSize)
  183.             DirtyCacheLabel.Caption = Str$(cacheStats.dirtyCacheBuffers)
  184.             CacheReadsLabel.Caption = Str$(cacheStats.cacheReadRequests)
  185.             CacheWritesLabel.Caption = Str$(cacheStats.cacheWriteRequests)
  186.             CacheHitsLabel.Caption = Str$(cacheStats.cacheHits)
  187.         End If
  188.     End If
  189. End Sub
  190. Sub ServerNameBox_Change ()
  191.     ccode% = GetConnectionID(ServerNameBox.Text, connID%)
  192.     If (ccode% <> SUCCESSFUL) Then
  193.         MsgBox "Unable to get connection ID", MB_OK, "Error"
  194.     Else
  195.         SetPreferredConnectionID (connID%)
  196.     End If
  197. End Sub
  198. Sub ServerNameBox_Click ()
  199.     ServerNameBox_Change
  200. End Sub
  201.