home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 27 / IOPROG_27.ISO / SOFT / ADSDK.ZIP / Samples / WinNT / Computer / App / connect.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-03-17  |  5.1 KB  |  172 lines

  1. VERSION 5.00
  2. Begin VB.Form frmConnect 
  3.    Caption         =   "WinnT: Connect To"
  4.    ClientHeight    =   3900
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4515
  8.    LinkTopic       =   "Form2"
  9.    ScaleHeight     =   3900
  10.    ScaleWidth      =   4515
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.Frame Frame2 
  13.       Caption         =   "Administrator Credentials "
  14.       Height          =   1455
  15.       Left            =   105
  16.       TabIndex        =   7
  17.       Top             =   0
  18.       Width           =   4215
  19.       Begin VB.TextBox txtAdminName 
  20.          Height          =   285
  21.          Left            =   1560
  22.          TabIndex        =   10
  23.          Text            =   "Administrator"
  24.          Top             =   360
  25.          Width           =   2415
  26.       End
  27.       Begin VB.TextBox txtAdminPassword 
  28.          Height          =   285
  29.          IMEMode         =   3  'DISABLE
  30.          Left            =   1560
  31.          PasswordChar    =   "*"
  32.          TabIndex        =   9
  33.          Top             =   720
  34.          Width           =   2415
  35.       End
  36.       Begin VB.CheckBox chcCredential 
  37.          Caption         =   "Use Current Credentials"
  38.          Height          =   255
  39.          Left            =   240
  40.          TabIndex        =   8
  41.          Top             =   1080
  42.          Width           =   2895
  43.       End
  44.       Begin VB.Label lblAdminName 
  45.          Caption         =   "Use&r Name:"
  46.          Height          =   255
  47.          Left            =   240
  48.          TabIndex        =   12
  49.          Top             =   360
  50.          Width           =   975
  51.       End
  52.       Begin VB.Label lblAdminPassword 
  53.          Caption         =   "Pass&word:"
  54.          Height          =   255
  55.          Left            =   240
  56.          TabIndex        =   11
  57.          Top             =   720
  58.          Width           =   855
  59.       End
  60.    End
  61.    Begin VB.CommandButton cmdCancel 
  62.       Caption         =   "Cancel"
  63.       Height          =   315
  64.       Left            =   2100
  65.       TabIndex        =   5
  66.       Top             =   3450
  67.       Width           =   1215
  68.    End
  69.    Begin VB.CommandButton cmdOK 
  70.       Caption         =   "OK"
  71.       Default         =   -1  'True
  72.       Height          =   315
  73.       Left            =   855
  74.       TabIndex        =   4
  75.       Top             =   3450
  76.       Width           =   1095
  77.    End
  78.    Begin VB.TextBox txtConnect 
  79.       Height          =   315
  80.       Left            =   315
  81.       TabIndex        =   2
  82.       Top             =   2820
  83.       Width           =   2490
  84.    End
  85.    Begin VB.OptionButton optComputer 
  86.       Caption         =   "Computer"
  87.       Height          =   255
  88.       Left            =   315
  89.       TabIndex        =   1
  90.       Top             =   2115
  91.       Width           =   1575
  92.    End
  93.    Begin VB.OptionButton optDomain 
  94.       Caption         =   "Domain"
  95.       Height          =   255
  96.       Left            =   330
  97.       TabIndex        =   0
  98.       Top             =   1815
  99.       Width           =   1575
  100.    End
  101.    Begin VB.Frame Frame1 
  102.       Caption         =   "Connect To"
  103.       Height          =   1740
  104.       Left            =   150
  105.       TabIndex        =   3
  106.       Top             =   1560
  107.       Width           =   4170
  108.       Begin VB.Label Label1 
  109.          Caption         =   "Domain/Computer Name:"
  110.          Height          =   195
  111.          Left            =   180
  112.          TabIndex        =   6
  113.          Top             =   990
  114.          Width           =   2130
  115.       End
  116.    End
  117. Attribute VB_Name = "frmConnect"
  118. Attribute VB_GlobalNameSpace = False
  119. Attribute VB_Creatable = False
  120. Attribute VB_PredeclaredId = True
  121. Attribute VB_Exposed = False
  122. '----------------------------------------------------------------------------
  123. '  Microsoft Active Directory 2.5 Sample Code
  124. '  Copyright (C) Microsoft Corporation, 1996 - 1999
  125. '  File:       frmConnect.frm
  126. '  Contents:   Connection Dialog
  127. '----------------------------------------------------------------------------
  128. Dim usrName As String
  129. Dim usrPassword As String
  130. Private Sub chcCredential_Click()
  131. If (chcCredential.Value = 1) Then
  132.   bCheck = False
  133.  Else
  134.   bCheck = True
  135.  End If
  136.  'Now set the controls based on the credential mode
  137.  txtAdminName.Enabled = bCheck
  138.  lblAdminName.Enabled = bCheck
  139.  txtAdminPassword.Enabled = bCheck
  140.  lblAdminPassword.Enabled = bCheck
  141. End Sub
  142. Private Sub cmdCancel_Click()
  143.   frmConnect.Hide
  144.   frmConnect.Tag = ""
  145. End Sub
  146. Private Sub cmdOK_Click()
  147. If (optComputer) Then
  148.   bind = txtConnect & ",computer"
  149.   bind = txtConnect
  150. End If
  151.  frmConnect.Tag = bind
  152. usrName = ""
  153. usrPassword = ""
  154. If (chcCredential = 0) Then
  155.    usrName = txtAdminName
  156.    usrPassword = txtAdminPassword
  157. End If
  158. frmConnect.Hide
  159. End Sub
  160. Private Sub Form_Load()
  161. usrName = ""
  162. usrPassword = ""
  163. chcCredential = 1
  164. chcCredential_Click
  165. End Sub
  166. Public Function GetUserName() As String
  167.   GetUserName = usrName
  168. End Function
  169. Public Function GetPassword() As String
  170.   GetPassword = usrPassword
  171. End Function
  172.