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

  1. VERSION 2.00
  2. Begin Form ConnForm 
  3.    Caption         =   "Connection Services Test"
  4.    Height          =   3630
  5.    Left            =   2280
  6.    LinkMode        =   1  'Source
  7.    LinkTopic       =   "Form1"
  8.    ScaleHeight     =   3225
  9.    ScaleWidth      =   3585
  10.    Top             =   1365
  11.    Width           =   3705
  12.    Begin CommandButton OKButton 
  13.       Caption         =   "&OK"
  14.       Height          =   372
  15.       Left            =   1440
  16.       TabIndex        =   4
  17.       Top             =   2760
  18.       Width           =   732
  19.    End
  20.    Begin ListBox connList 
  21.       Height          =   615
  22.       Left            =   240
  23.       TabIndex        =   9
  24.       Top             =   2040
  25.       Width           =   3135
  26.    End
  27.    Begin Label Label7 
  28.       Caption         =   "Login Time"
  29.       Height          =   252
  30.       Left            =   1680
  31.       TabIndex        =   11
  32.       Top             =   1680
  33.       Width           =   972
  34.    End
  35.    Begin Label Label6 
  36.       Caption         =   "Conn #"
  37.       Height          =   252
  38.       Left            =   240
  39.       TabIndex        =   10
  40.       Top             =   1680
  41.       Width           =   732
  42.    End
  43.    Begin Label Label5 
  44.       Caption         =   "You are connected at:"
  45.       Height          =   252
  46.       Left            =   120
  47.       TabIndex        =   8
  48.       Top             =   1320
  49.       Width           =   2292
  50.    End
  51.    Begin Label socketLabel 
  52.       Height          =   252
  53.       Left            =   1800
  54.       TabIndex        =   7
  55.       Top             =   960
  56.       Width           =   1572
  57.    End
  58.    Begin Label Label4 
  59.       Alignment       =   1  'Right Justify
  60.       Caption         =   "Socket:"
  61.       Height          =   252
  62.       Left            =   600
  63.       TabIndex        =   3
  64.       Top             =   960
  65.       Width           =   852
  66.    End
  67.    Begin Label nodeLabel 
  68.       Height          =   252
  69.       Left            =   1800
  70.       TabIndex        =   6
  71.       Top             =   720
  72.       Width           =   1572
  73.    End
  74.    Begin Label Label3 
  75.       Alignment       =   1  'Right Justify
  76.       Caption         =   "Node:"
  77.       Height          =   252
  78.       Left            =   600
  79.       TabIndex        =   2
  80.       Top             =   720
  81.       Width           =   852
  82.    End
  83.    Begin Label networkLabel 
  84.       Height          =   252
  85.       Left            =   1800
  86.       TabIndex        =   5
  87.       Top             =   480
  88.       Width           =   1572
  89.    End
  90.    Begin Label Label2 
  91.       Alignment       =   1  'Right Justify
  92.       Caption         =   "Network:"
  93.       Height          =   252
  94.       Left            =   600
  95.       TabIndex        =   1
  96.       Top             =   480
  97.       Width           =   852
  98.    End
  99.    Begin Label Label1 
  100.       Caption         =   "Your internetwork address:"
  101.       Height          =   252
  102.       Left            =   120
  103.       TabIndex        =   0
  104.       Top             =   120
  105.       Width           =   2412
  106.    End
  107. Sub Form_Load ()
  108.     Dim nodeAddr As NodeAddress
  109.     Static conns(MAX_CONNS) As Long
  110.     Static liT As DATE_AND_TIME
  111.     connNum& = GetConnectionNumber()
  112.     ccode% = GetInternetAddress(connNum&, network&, nodeAddr, socket%)
  113.     If (ccode% <> SUCCESSFUL) Then
  114.         MsgBox "Unable to get connection number for connection " + Format$(connNum&), MB_OK, "Error"
  115.     Else
  116.         networkLabel.Caption = Hex$(LongSwap(network&))
  117.         nodeLabel.Caption = Hex$(LongSwap(nodeAddr.nodeHi)) + Hex$(IntSwap(nodeAddr.nodeLo))
  118.         socketLabel.Caption = Hex$(IntSwap(socket%))
  119.         myName$ = String$(48, 0)
  120.         ccode% = GetConnectionInformation(connNum&, myName$, OT_USER, objectID&, liT)
  121.         If (ccode% <> SUCCESSFUL) Then
  122.             MsgBox "Unable to get connection information for connection " + Format$(connNum&), MB_OK, "Error"
  123.         Else
  124.             ccode% = GetObjectConnectionNumbers(myName$, OT_USER, numConns&, conns(0), MAX_CONNS)
  125.             If (ccode% <> SUCCESSFUL) Then
  126.                 MsgBox "Unable to get connection number for " + myName$, MB_OK, "Error"
  127.             Else
  128.                 For i% = 0 To (numConns& - 1)
  129.                     ccode% = GetConnectionInformation(conns(i%), myName$, OT_USER, objectID&, liT)
  130.                     If (ccode% <> SUCCESSFUL) Then
  131.                         MsgBox "Unable to get connection information for connection " + Format$(connNum&), MB_OK, "Error"
  132.                     Else
  133.                         temp$ = Str$(conns(i%)) + Space$(15)
  134.                         temp$ = temp$ + Format$(Asc(liT.hour), "00") + ":" + Format$(Asc(liT.minute), "00") + ":" + Format$(Asc(liT.second), "00") + "  "
  135.                         temp$ = temp$ + Format$(Asc(liT.month), "00") + "/" + Format$(Asc(liT.date), "00") + "/" + Format$(Asc(liT.year), "00")
  136.                         connList.AddItem temp$
  137.                     End If
  138.                 Next
  139.             End If
  140.         End If
  141.     End If
  142. End Sub
  143. Sub OKButton_Click ()
  144.     Unload ConnForm
  145. End Sub
  146.