home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / networ1a / finger.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-07-16  |  3.8 KB  |  129 lines

  1. VERSION 5.00
  2. Object = "{FFACF7F3-B868-11CE-84A8-08005A9B23BD}#1.7#0"; "DSSOCK32.OCX"
  3. Begin VB.Form Form2 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Finger Example"
  6.    ClientHeight    =   3555
  7.    ClientLeft      =   1140
  8.    ClientTop       =   1515
  9.    ClientWidth     =   6165
  10.    LinkTopic       =   "Form2"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    PaletteMode     =   1  'UseZOrder
  14.    ScaleHeight     =   3555
  15.    ScaleWidth      =   6165
  16.    ShowInTaskbar   =   0   'False
  17.    Begin VB.TextBox theUser 
  18.       Height          =   285
  19.       Left            =   1680
  20.       TabIndex        =   5
  21.       Top             =   3720
  22.       Width           =   855
  23.    End
  24.    Begin VB.CommandButton Command1 
  25.       Caption         =   "finger"
  26.       Height          =   255
  27.       Left            =   4680
  28.       TabIndex        =   3
  29.       Top             =   0
  30.       Width           =   975
  31.    End
  32.    Begin VB.ListBox lResponse 
  33.       Height          =   3015
  34.       Left            =   0
  35.       TabIndex        =   1
  36.       Top             =   360
  37.       Width           =   6135
  38.    End
  39.    Begin VB.TextBox tHost 
  40.       Height          =   285
  41.       Left            =   1320
  42.       TabIndex        =   0
  43.       Top             =   0
  44.       Width           =   2775
  45.    End
  46.    Begin dsSocketLib.dsSocket dsSocket1 
  47.       Height          =   420
  48.       Left            =   5760
  49.       TabIndex        =   4
  50.       Top             =   0
  51.       Width           =   420
  52.       _Version        =   65543
  53.       _ExtentX        =   741
  54.       _ExtentY        =   741
  55.       _StockProps     =   64
  56.       LocalPort       =   0
  57.       RemoteHost      =   ""
  58.       RemotePort      =   79
  59.       ServiceName     =   ""
  60.       RemoteDotAddr   =   ""
  61.       Linger          =   -1  'True
  62.       Timeout         =   10
  63.       LineMode        =   0   'False
  64.       EOLChar         =   10
  65.       BindConnect     =   0   'False
  66.       SocketType      =   0
  67.    End
  68.    Begin VB.Label Label1 
  69.       BackStyle       =   0  'Transparent
  70.       Caption         =   "host to finger:"
  71.       BeginProperty Font 
  72.          Name            =   "MS Sans Serif"
  73.          Size            =   9.75
  74.          Charset         =   0
  75.          Weight          =   400
  76.          Underline       =   0   'False
  77.          Italic          =   0   'False
  78.          Strikethrough   =   0   'False
  79.       EndProperty
  80.       Height          =   255
  81.       Left            =   0
  82.       TabIndex        =   2
  83.       Top             =   0
  84.       Width           =   1335
  85.    End
  86. Attribute VB_Name = "Form2"
  87. Attribute VB_GlobalNameSpace = False
  88. Attribute VB_Creatable = False
  89. Attribute VB_PredeclaredId = True
  90. Attribute VB_Exposed = False
  91. Private Sub Command1_Click()
  92. On Error Resume Next
  93. ' check to see if the user is lookin up a email
  94. ' address or a domain.
  95. x% = InStr(tHost, "@")
  96. If x% <> 0 Then
  97.     rUser$ = Left$(tHost, x% - 1)
  98.     rHost$ = Mid$(tHost, x% + 1)
  99.     rUser$ = ""
  100.     rHost$ = tHost
  101. End If
  102. ' sets the thing to finger to a textbox so we can
  103. ' send the data to the server after we're connected
  104. theUser = rHost$
  105. ' start the connection.
  106. lResponse.Clear
  107. dsSocket1.RemoteHost = rHost$
  108. lResponse.AddItem "  connecting to " & rHost$
  109. dsSocket1.RemotePort = 79
  110. dsSocket1.Connect
  111. End Sub
  112. Private Sub dsSocket1_Connect()
  113.  ' after connecting, clear the info from a previous
  114.  ' finger.
  115. lResponse.Clear
  116. dsSocket1.Send = theUser & Chr$(10)
  117. End Sub
  118. Private Sub dsSocket1_Exception(ErrorCode As Integer, ErrorDesc As String)
  119. lResponse.AddItem ErrorDesc
  120. End Sub
  121. Private Sub dsSocket1_Receive(ReceiveData As String)
  122.  ' add the data to the listbox.
  123. lResponse.AddItem ReceiveData
  124. End Sub
  125. Private Sub Form_Unload(Cancel As Integer)
  126. On Error Resume Next
  127. dsSocket1.Close
  128. End Sub
  129.