home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD5511552000.psc / frm_CreateAccount.frm (.txt) next >
Encoding:
Visual Basic Form  |  2000-05-06  |  7.5 KB  |  230 lines

  1. VERSION 5.00
  2. Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
  3. Begin VB.Form frm_CreateAccount 
  4.    Caption         =   "Create New Account"
  5.    ClientHeight    =   2325
  6.    ClientLeft      =   5670
  7.    ClientTop       =   4875
  8.    ClientWidth     =   3990
  9.    Icon            =   "frm_CreateAccount.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    ScaleHeight     =   2325
  13.    ScaleWidth      =   3990
  14.    StartUpPosition =   2  'CenterScreen
  15.    Begin VB.CommandButton Command3 
  16.       Caption         =   "C&hange"
  17.       Height          =   375
  18.       Left            =   1440
  19.       TabIndex        =   10
  20.       Top             =   1440
  21.       Width           =   1095
  22.    End
  23.    Begin VB.Timer Timer1 
  24.       Interval        =   500
  25.       Left            =   3000
  26.       Top             =   0
  27.    End
  28.    Begin VB.TextBox Text3 
  29.       BeginProperty Font 
  30.          Name            =   "Arial"
  31.          Size            =   8.25
  32.          Charset         =   0
  33.          Weight          =   400
  34.          Underline       =   0   'False
  35.          Italic          =   0   'False
  36.          Strikethrough   =   0   'False
  37.       EndProperty
  38.       Height          =   285
  39.       Left            =   120
  40.       TabIndex        =   7
  41.       Text            =   "127.0.0.1"
  42.       Top             =   360
  43.       Width           =   3735
  44.    End
  45.    Begin VB.CommandButton Command2 
  46.       Caption         =   "Close"
  47.       Height          =   375
  48.       Left            =   2760
  49.       TabIndex        =   5
  50.       Top             =   1440
  51.       Width           =   1095
  52.    End
  53.    Begin VB.CommandButton Command1 
  54.       Caption         =   "&Create"
  55.       Height          =   375
  56.       Left            =   120
  57.       TabIndex        =   4
  58.       Top             =   1440
  59.       Width           =   1095
  60.    End
  61.    Begin VB.TextBox Text2 
  62.       BeginProperty Font 
  63.          Name            =   "Arial"
  64.          Size            =   8.25
  65.          Charset         =   0
  66.          Weight          =   400
  67.          Underline       =   0   'False
  68.          Italic          =   0   'False
  69.          Strikethrough   =   0   'False
  70.       EndProperty
  71.       Height          =   285
  72.       Left            =   2040
  73.       MaxLength       =   20
  74.       TabIndex        =   3
  75.       Text            =   "Password"
  76.       Top             =   960
  77.       Width           =   1815
  78.    End
  79.    Begin VB.TextBox Text1 
  80.       BeginProperty Font 
  81.          Name            =   "Arial"
  82.          Size            =   8.25
  83.          Charset         =   0
  84.          Weight          =   400
  85.          Underline       =   0   'False
  86.          Italic          =   0   'False
  87.          Strikethrough   =   0   'False
  88.       EndProperty
  89.       Height          =   285
  90.       Left            =   120
  91.       MaxLength       =   40
  92.       MultiLine       =   -1  'True
  93.       TabIndex        =   0
  94.       Text            =   "frm_CreateAccount.frx":030A
  95.       Top             =   960
  96.       Width           =   1815
  97.    End
  98.    Begin MSWinsockLib.Winsock Winsock1 
  99.       Left            =   3480
  100.       Top             =   0
  101.       _ExtentX        =   741
  102.       _ExtentY        =   741
  103.       _Version        =   393216
  104.    End
  105.    Begin VB.Label Label2 
  106.       Caption         =   "Status :"
  107.       Height          =   255
  108.       Left            =   120
  109.       TabIndex        =   9
  110.       Top             =   1920
  111.       Width           =   615
  112.    End
  113.    Begin VB.Label Label1 
  114.       Caption         =   "Connection Closed."
  115.       Height          =   255
  116.       Left            =   840
  117.       TabIndex        =   8
  118.       Top             =   1920
  119.       Width           =   3015
  120.    End
  121.    Begin VB.Label Label14 
  122.       Caption         =   "Server Hostname / IP Address :"
  123.       BeginProperty Font 
  124.          Name            =   "Arial"
  125.          Size            =   8.25
  126.          Charset         =   0
  127.          Weight          =   400
  128.          Underline       =   0   'False
  129.          Italic          =   0   'False
  130.          Strikethrough   =   0   'False
  131.       EndProperty
  132.       Height          =   255
  133.       Left            =   120
  134.       TabIndex        =   6
  135.       Top             =   120
  136.       Width           =   3495
  137.    End
  138.    Begin VB.Label Label12 
  139.       Caption         =   "Password :"
  140.       BeginProperty Font 
  141.          Name            =   "Arial"
  142.          Size            =   8.25
  143.          Charset         =   0
  144.          Weight          =   400
  145.          Underline       =   0   'False
  146.          Italic          =   0   'False
  147.          Strikethrough   =   0   'False
  148.       EndProperty
  149.       Height          =   255
  150.       Left            =   2040
  151.       TabIndex        =   2
  152.       Top             =   720
  153.       Width           =   1815
  154.    End
  155.    Begin VB.Label Label11 
  156.       Caption         =   "Username  :"
  157.       BeginProperty Font 
  158.          Name            =   "Arial"
  159.          Size            =   8.25
  160.          Charset         =   0
  161.          Weight          =   400
  162.          Underline       =   0   'False
  163.          Italic          =   0   'False
  164.          Strikethrough   =   0   'False
  165.       EndProperty
  166.       Height          =   255
  167.       Left            =   120
  168.       TabIndex        =   1
  169.       Top             =   720
  170.       Width           =   1455
  171.    End
  172. Attribute VB_Name = "frm_CreateAccount"
  173. Attribute VB_GlobalNameSpace = False
  174. Attribute VB_Creatable = False
  175. Attribute VB_PredeclaredId = True
  176. Attribute VB_Exposed = False
  177. Dim connection As Boolean, newa As Boolean, changea As Boolean, averified As Boolean
  178. Private Sub Command3_Click()
  179. If averified = False Then
  180. newa = False: changea = True
  181. If Winsock1.State <> 0 Then Winsock1.Close
  182. Winsock1.Connect Text3, "12340"
  183. Winsock1.SendData "@chng" & Text1 & "@password" & Text2
  184. End If
  185. End Sub
  186. Private Sub Form_Unload(Cancel As Integer)
  187. SetVals
  188. End Sub
  189. Private Sub Text1_Change()
  190. txt$ = Text1
  191. Text1 = frm_NewServer.StringChange(txt$)
  192. Text1.SelStart = Len(Text1)
  193. End Sub
  194. Private Sub Text2_Change()
  195. txt$ = Text2
  196. Text2 = frm_NewServer.StringChange(txt$)
  197. Text2.SelStart = Len(Text2)
  198. End Sub
  199. Private Sub winsock1_Connect()
  200. If newa = True Then
  201. data$ = "@name" & Text1 & "@password" & Text2
  202. data$ = "@came" & Text1 & "@password" & Text2
  203. End If
  204. Winsock1.SendData data$
  205. End Sub
  206. Private Sub Command1_Click()
  207. If Winsock1.State <> 0 Then Winsock1.Close
  208. newa = True: changea = False
  209. Winsock1.Connect Text3, "12340"
  210. End Sub
  211. Private Sub Command2_Click()
  212. Unload Me
  213. End Sub
  214. Private Sub Timer1_Timer()
  215. If Winsock1.State = 7 And connection = False Then connection = True: Label1.Caption = "Connection Established."
  216. End Sub
  217. Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
  218. Dim data$
  219. Winsock1.GetData data$
  220. If data$ = "dupe" Then Winsock1.Close: MsgBox "Name already exists in database.", vbCritical: Label1.Caption = "Connection Closed.": SetVals
  221. If data$ = "success" Then Winsock1.Close: MsgBox "Account Created.", vbInformation: Label1.Caption = "Connection Closed.": Unload Me
  222. If data$ = "nov" Then Winsock1.Close: MsgBox "Username / Password incorrect.", vbInformation: Label1.Caption = "Connection Closed.": SetVals
  223. If data$ = "v" Then averified = True: MsgBox "Account Verified. Enter new password and click change.", vbInformation: Text1.Enabled = False
  224. If data$ = "@changed" Then Winsock1.Close: MsgBox "Password changed.", vbInformation: Unload Me
  225. If data$ = "nc" Then Winsock1.Close: MsgBox "Error. Password not changed.", vbInformation: Unload Me
  226. End Sub
  227. Sub SetVals()
  228. connection = False: newa = False: changea = False: averified = False
  229. End Sub
  230.