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

  1. VERSION 2.00
  2. Begin Form BindForm 
  3.    Caption         =   "Bindery Services Test"
  4.    Height          =   4560
  5.    Left            =   930
  6.    LinkMode        =   1  'Source
  7.    LinkTopic       =   "Form1"
  8.    ScaleHeight     =   4155
  9.    ScaleWidth      =   8895
  10.    Top             =   975
  11.    Width           =   9015
  12.    Begin CommandButton CloseButton 
  13.       Caption         =   "&OK"
  14.       Height          =   372
  15.       Left            =   6720
  16.       TabIndex        =   11
  17.       Top             =   3600
  18.       Width           =   1332
  19.    End
  20.    Begin ComboBox ServerNameBox 
  21.       Height          =   288
  22.       Left            =   2400
  23.       Sorted          =   -1  'True
  24.       TabIndex        =   0
  25.       Text            =   "ServerNameBox"
  26.       Top             =   3600
  27.       Width           =   2412
  28.    End
  29.    Begin ListBox BinderyObjList 
  30.       FontBold        =   -1  'True
  31.       FontItalic      =   0   'False
  32.       FontName        =   "Courier"
  33.       FontSize        =   9.75
  34.       FontStrikethru  =   0   'False
  35.       FontUnderline   =   0   'False
  36.       Height          =   2370
  37.       Left            =   240
  38.       Sorted          =   -1  'True
  39.       TabIndex        =   9
  40.       Top             =   840
  41.       Width           =   8460
  42.    End
  43.    Begin Label Label10 
  44.       Caption         =   "File Server:"
  45.       Height          =   252
  46.       Left            =   1200
  47.       TabIndex        =   10
  48.       Top             =   3600
  49.       Width           =   1092
  50.    End
  51.    Begin Label Label1 
  52.       Caption         =   "Add Props"
  53.       Height          =   252
  54.       Left            =   7560
  55.       TabIndex        =   8
  56.       Top             =   480
  57.       Width           =   972
  58.    End
  59.    Begin Label Label7 
  60.       Caption         =   "Scan"
  61.       Height          =   252
  62.       Left            =   7080
  63.       TabIndex        =   7
  64.       Top             =   480
  65.       Width           =   492
  66.    End
  67.    Begin Label Label9 
  68.       BorderStyle     =   1  'Fixed Single
  69.       Height          =   12
  70.       Left            =   7080
  71.       TabIndex        =   12
  72.       Top             =   360
  73.       Width           =   1452
  74.    End
  75.    Begin Label Label4 
  76.       Caption         =   "Object ID"
  77.       Height          =   252
  78.       Left            =   4920
  79.       TabIndex        =   6
  80.       Top             =   360
  81.       Width           =   852
  82.    End
  83.    Begin Label Label3 
  84.       Caption         =   "Object Type"
  85.       Height          =   252
  86.       Left            =   3120
  87.       TabIndex        =   5
  88.       Top             =   360
  89.       Width           =   1092
  90.    End
  91.    Begin Label Label2 
  92.       Caption         =   "Object Name"
  93.       Height          =   252
  94.       Left            =   312
  95.       TabIndex        =   4
  96.       Top             =   372
  97.       Width           =   1212
  98.    End
  99.    Begin Label Label6 
  100.       Alignment       =   2  'Center
  101.       Caption         =   "Dyn/ Stat"
  102.       Height          =   372
  103.       Left            =   6384
  104.       TabIndex        =   3
  105.       Top             =   252
  106.       Width           =   612
  107.    End
  108.    Begin Label Label5 
  109.       Alignment       =   2  'Center
  110.       Caption         =   "Has Props"
  111.       Height          =   372
  112.       Left            =   5880
  113.       TabIndex        =   2
  114.       Top             =   240
  115.       Width           =   612
  116.    End
  117.    Begin Label Label8 
  118.       Caption         =   "Access Control"
  119.       Height          =   252
  120.       Left            =   7140
  121.       TabIndex        =   1
  122.       Top             =   84
  123.       Width           =   1332
  124.    End
  125. Sub CloseButton_Click ()
  126.     Unload BindForm
  127. End Sub
  128. Sub Form_Load ()
  129.     For connID% = 1 To 8
  130.         fileServerName$ = String$(48, 0)
  131.         If (IsConnectionIDInUse(connID%) = 1) Then
  132.             GetFileServerName connID%, fileServerName$
  133.             ServerNameBox.AddItem fileServerName$
  134.         End If
  135.     Next connID%
  136.     'get name of default file server for combo box
  137.     fileServerName$ = GetDefaultFileServerName()
  138.     ServerNameBox.Text = fileServerName$
  139.     Main.MousePointer = 0
  140. End Sub
  141. Sub Form_Unload (Cancel As Integer)
  142.     SetPreferredConnectionID (originalPrefConnID%)
  143. End Sub
  144. Sub ScanBindery ()
  145.     Dim objectType As String * 6
  146.     BinderyObjList.Clear
  147.     oID& = -1   'initialize object ID to -1 for first call to ScanBinderyObject
  148.     Do
  149.         oName$ = String$(48, 0)
  150.         ccode% = ScanBinderyObject("*", OT_WILD, oID&, oName$, oType%, oHasProps%, oFlag%, oSecurity%)
  151.         If (ccode% = SUCCESSFUL) Then
  152.             
  153.             'take all characters of object name up to terminating null
  154.             out$ = Left$(oName$, InStr(oName$, Chr$(0)) - 1)
  155.             'then take first 20 chars
  156.             out$ = Left$(out$, 20)
  157.             'pad with spaces
  158.             out$ = out$ + Space$(22 - Len(out$))
  159.             
  160.             Select Case oType%
  161.                 Case OT_USER
  162.                     out$ = out$ + "User            "
  163.                 Case OT_USER_GROUP
  164.                     out$ = out$ + "User Group      "
  165.                 Case OT_PRINT_QUEUE
  166.                     out$ = out$ + "Print Queue     "
  167.                 Case OT_FILE_SERVER
  168.                     out$ = out$ + "File Server     "
  169.                 Case OT_JOB_SERVER
  170.                     out$ = out$ + "Job Server      "
  171.                 Case OT_GATEWAY
  172.                     out$ = out$ + "Gateway         "
  173.                 Case OT_PRINT_SERVER
  174.                     out$ = out$ + "Print Server    "
  175.                 Case OT_ARCHIVE_QUEUE
  176.                     out$ = out$ + "Archive Queue   "
  177.                 Case OT_ARCHIVE_SERVER
  178.                     out$ = out$ + "Archive Server  "
  179.                 Case OT_JOB_QUEUE
  180.                     out$ = out$ + "Job Queue       "
  181.                 Case OT_ADMINISTRATION
  182.                     out$ = out$ + "Administration  "
  183.                 Case OT_NAS_SNA_GATEWAY
  184.                     out$ = out$ + "NAS SNA Gateway "
  185.                 Case OT_NACS
  186.                     out$ = out$ + "NACS            "
  187.                 Case OT_REMOTE_BRIDGE_SERVER
  188.                     out$ = out$ + "Rem Bridge Serv "
  189.                 Case OT_BRIDGE_SERVER
  190.                     out$ = out$ + "Bridge Server   "
  191.                 Case OT_TCPIP_GATEWAY
  192.                     out$ = out$ + "TCP/IP Gateway  "
  193.                 Case OT_GATE
  194.                     out$ = out$ + "Gateway         "
  195.                 Case OT_TIME_SYNCHRONIZATION_SERVER
  196.                     out$ = out$ + "Time Synch Serv "
  197.                 Case OT_ARCHIVE_SRV
  198.                     out$ = out$ + "Archive Server  "
  199.                 Case OT_ADVERTISING_PRINT_SERVER
  200.                     out$ = out$ + "Adver Print Srv "
  201.                 Case OT_BTRIEVE_VAP_NLM_5XX
  202.                     out$ = out$ + "Btrieve v5.xx   "
  203.                 Case OT_SQL_VAP_NLM
  204.                     out$ = out$ + "SQL VAP/NLM     "
  205.                 Case OT_XTREE_NETWORK
  206.                     out$ = out$ + "Xtree Net Ver   "
  207.                 Case OT_BTRIEVE_VAP_NLM_4XX
  208.                     out$ = out$ + "Btrieve v4.xx   "
  209.                 Case OT_APPLETALK_GATEWAY
  210.                     out$ = out$ + "AppleTalk Gatew "
  211.                 Case OT_X25_GATEWAY
  212.                     out$ = out$ + "X.25 Gateway    "
  213.                 Case OT_WAN_COPY
  214.                     out$ = out$ + "WAN Copy        "
  215.                 Case OT_TES_NETWARE_VMS
  216.                     out$ = out$ + "TES-NetWare VMS "
  217.                 Case OT_NETWARE_ACCESS_SERVER
  218.                     out$ = out$ + "NW Access Serv  "
  219.                 Case OT_PORTABLE_NETWARE
  220.                     out$ = out$ + "Portable NetW   "
  221.                 Case OT_COMPAQ_IDA_STATUS_MONITOR
  222.                     out$ = out$ + "Compaq IDA Stat "
  223.                 Case OT_NETWARE_386_SERVER
  224.                     out$ = out$ + "NetWare 386 Srv "
  225.                 Case OT_CSA_MUX
  226.                     out$ = out$ + "CSA MUX         "
  227.                 Case OT_CSA_LCA
  228.                     out$ = out$ + "CSA LCA         "
  229.                 Case OT_CSA_CM
  230.                     out$ = out$ + "CSA CM          "
  231.                 Case OT_CSA_SMA
  232.                     out$ = out$ + "CSA SMA         "
  233.                 Case OT_CSA_DBA
  234.                     out$ = out$ + "CSA DBA         "
  235.                 Case OT_CSA_NMA
  236.                     out$ = out$ + "CSA NMA         "
  237.                 Case OT_CSA_SSA
  238.                     out$ = out$ + "CSA SSA         "
  239.                 Case OT_CSA_STATUS
  240.                     out$ = out$ + "CSA STATUS      "
  241.                 Case OT_CSA_APPC
  242.                     out$ = out$ + "CSA APPC        "
  243.                 Case OT_SNA_TEST
  244.                     out$ = out$ + "SNA TEST        "
  245.                 Case OT_CSA_TRACE
  246.                     out$ = out$ + "CSA TRACE       "
  247.                 Case OT_COMMUNICATIONS_EXECUTIVE
  248.                     out$ = out$ + "Comm Executive  "
  249.                 Case OT_NNS_DOMAIN
  250.                     out$ = out$ + "NNS Domain      "
  251.                 Case OT_NNS_PROFILE
  252.                     out$ = out$ + "NNS Profile     "
  253.                 Case OT_NNS_QUEUE
  254.                     out$ = out$ + "NNS Queue       "
  255.                 Case OT_WORDPERFECT_NETWORK
  256.                     out$ = out$ + "WordPerfect Net "
  257.                 Case Else
  258.                     objectType = Str$(oType%)
  259.                     out$ = out$ + "[" + objectType + "]" + "        "
  260.             End Select
  261.             'format the bindery object ID as 8 hex digits, with leading zeros
  262.             out$ = out$ + String$((8 - Len(Hex$(oID&))), "0") + Hex$(oID&) + "  "
  263.             'does the bindery object have properties?
  264.             If oHasProps% = 0 Then
  265.                 out$ = out$ + "N   "
  266.             Else
  267.                 out$ = out$ + "Y   "
  268.             End If
  269.             'is the bindery object static or dynamic?
  270.             If oFlag% = 0 Then
  271.                 out$ = out$ + "Stat  "
  272.             Else
  273.                 out$ = out$ + "Dyn   "
  274.             End If
  275.             'who can scan for the bindery object,
  276.             'and who can add properties?
  277.             Select Case (oSecurity% And &HF)
  278.                 Case &H0
  279.                     out$ = out$ + "Any  "   'anyone can scan for the object
  280.                 Case &H1
  281.                     out$ = out$ + "Log  "   'any logged user can scan
  282.                 Case &H2
  283.                     out$ = out$ + "Obj  "   'only the object can scan for itself
  284.                 Case &H3
  285.                     out$ = out$ + "Sup  "   'only the supervisor can scan
  286.                 Case &H4
  287.                     out$ = out$ + "OS   "   'only the operating system can scan
  288.             End Select
  289.             
  290.             Select Case (oSecurity% And &HF0)
  291.                 Case &H0
  292.                     out$ = out$ + "Any  "   'anyone can add properties to the object
  293.                 Case &H10
  294.                     out$ = out$ + "Log  "   'any logged user can add properties
  295.                 Case &H20
  296.                     out$ = out$ + "Obj  "   'only the object can add props to itself
  297.                 Case &H30
  298.                     out$ = out$ + "Sup  "   'only the supervisor can add props
  299.                 Case &H40
  300.                     out$ = out$ + "OS   "   'only the OS can add properties
  301.             End Select
  302.             
  303.             'finally, add one more entry to the list
  304.             'of bindery objects
  305.             BinderyObjList.AddItem out$
  306.         End If
  307.     Loop Until ccode%
  308. End Sub
  309. Sub ServerNameBox_Change ()
  310.     prefServer$ = ServerNameBox.Text
  311.     ccode% = GetConnectionID(prefServer$, connID%)
  312.     If (ccode% = SUCCESSFUL) Then
  313.         SetPreferredConnectionID (connID%)  'tell which file server to send
  314.                                             'requests to
  315.         Screen.MousePointer = 11
  316.         ScanBindery                         'then go scan its bindery
  317.         Screen.MousePointer = 0
  318.     Else
  319.         MsgBox "Unable to get connection ID of server " + prefServer$, MB_OK, "Error"
  320.     End If
  321. End Sub
  322. Sub ServerNameBox_Click ()
  323.     ServerNameBox_Change
  324. End Sub
  325.