[ActiveLock-Development] CVS: activelock2/test frmMain.frm,1.2,1.3
Brought to you by:
ialkan
From: Thanh H. T. <th...@us...> - 2003-07-23 03:50:33
|
Update of /cvsroot/activelock/activelock2/test In directory sc8-pr-cvs1:/tmp/cvs-serv11986 Modified Files: frmMain.frm Log Message: - Fixed bug: was Register button was using the wrong text field for liberation key - enabled/disabled the 3rd tab appropriate based on validity of license Index: frmMain.frm =================================================================== RCS file: /cvsroot/activelock/activelock2/test/frmMain.frm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- frmMain.frm 21 Jul 2003 08:54:38 -0000 1.2 +++ frmMain.frm 23 Jul 2003 03:50:26 -0000 1.3 @@ -22,48 +22,35 @@ _ExtentX = 13996 _ExtentY = 11033 _Version = 393216 + Tab = 1 TabHeight = 520 TabCaption(0) = "Admin" TabPicture(0) = "frmMain.frx":0000 - Tab(0).ControlEnabled= -1 'True + Tab(0).ControlEnabled= 0 'False Tab(0).Control(0)= "Label1" - Tab(0).Control(0).Enabled= 0 'False Tab(0).Control(1)= "Label2" - Tab(0).Control(1).Enabled= 0 'False Tab(0).Control(2)= "Label3" - Tab(0).Control(2).Enabled= 0 'False Tab(0).Control(3)= "Label9" - Tab(0).Control(3).Enabled= 0 'False Tab(0).Control(4)= "Label10" - Tab(0).Control(4).Enabled= 0 'False Tab(0).Control(5)= "lblExpiry" - Tab(0).Control(5).Enabled= 0 'False Tab(0).Control(6)= "lblDays" - Tab(0).Control(6).Enabled= 0 'False Tab(0).Control(7)= "cmdSoftwareCodeGen" - Tab(0).Control(7).Enabled= 0 'False Tab(0).Control(8)= "cmbLicClass" - Tab(0).Control(8).Enabled= 0 'False Tab(0).Control(9)= "txtName" - Tab(0).Control(9).Enabled= 0 'False Tab(0).Control(10)= "txtVersion" - Tab(0).Control(10).Enabled= 0 'False Tab(0).Control(11)= "txtSoftwareCodePriv" - Tab(0).Control(11).Enabled= 0 'False Tab(0).Control(12)= "txtSoftwareCodePub" - Tab(0).Control(12).Enabled= 0 'False Tab(0).Control(13)= "cmbLicType" - Tab(0).Control(13).Enabled= 0 'False Tab(0).Control(14)= "txtDays" - Tab(0).Control(14).Enabled= 0 'False Tab(0).Control(15)= "fraKeyGen" - Tab(0).Control(15).Enabled= 0 'False Tab(0).ControlCount= 16 TabCaption(1) = "Registration" TabPicture(1) = "frmMain.frx":001C - Tab(1).ControlEnabled= 0 'False + Tab(1).ControlEnabled= -1 'True Tab(1).Control(0)= "fraReg" + Tab(1).Control(0).Enabled= 0 'False Tab(1).Control(1)= "fraRegStatus" + Tab(1).Control(1).Enabled= 0 'False Tab(1).ControlCount= 2 TabCaption(2) = "Test Functionality" TabPicture(2) = "frmMain.frx":0038 @@ -75,7 +62,7 @@ Begin VB.Frame fraKeyGen Caption = "Key Generator" Height = 2415 - Left = 120 + Left = -74880 TabIndex = 43 Top = 2760 Width = 7455 @@ -122,7 +109,7 @@ Begin VB.TextBox txtDays BackColor = &H80000011& Height = 285 - Left = 1320 + Left = -73680 Locked = -1 'True TabIndex = 40 Text = "30" @@ -132,7 +119,7 @@ Begin VB.ComboBox cmbLicType Height = 315 ItemData = "frmMain.frx":0054 - Left = 1320 + Left = -73680 List = "frmMain.frx":0061 Style = 2 'Dropdown List TabIndex = 3 @@ -142,7 +129,7 @@ Begin VB.TextBox txtSoftwareCodePub BackColor = &H80000011& Height = 285 - Left = 3840 + Left = -71160 Locked = -1 'True TabIndex = 34 Top = 960 @@ -151,7 +138,7 @@ Begin VB.TextBox txtSoftwareCodePriv BackColor = &H80000011& Height = 285 - Left = 1320 + Left = -73680 Locked = -1 'True TabIndex = 35 Top = 960 @@ -160,7 +147,7 @@ Begin VB.TextBox txtVersion BackColor = &H80000011& Height = 285 - Left = 1320 + Left = -73680 Locked = -1 'True TabIndex = 38 Top = 720 @@ -169,7 +156,7 @@ Begin VB.TextBox txtName BackColor = &H80000011& Height = 285 - Left = 1320 + Left = -73680 Locked = -1 'True TabIndex = 36 Top = 480 @@ -297,7 +284,7 @@ TickerFontSize = 11.25 TickerFlash = 0 'False TickerPlaySound = 0 'False - TickerScrollX = 168 + TickerScrollX = 321 BalloonTipIcon = 0 BalloonTipText = "No Messages" End @@ -331,7 +318,7 @@ Begin VB.Frame fraRegStatus Caption = "Status" Height = 2655 - Left = -74880 + Left = 120 TabIndex = 11 Top = 480 Width = 7695 @@ -390,7 +377,7 @@ Begin VB.Frame fraReg Caption = "Register" Height = 2895 - Left = -74880 + Left = 120 TabIndex = 7 Top = 3240 Width = 7695 @@ -462,7 +449,7 @@ Begin VB.ComboBox cmbLicClass Height = 315 ItemData = "frmMain.frx":0136 - Left = 1320 + Left = -73680 List = "frmMain.frx":0140 Style = 2 'Dropdown List TabIndex = 4 @@ -473,7 +460,7 @@ Caption = "&Generate" Enabled = 0 'False Height = 255 - Left = 6480 + Left = -68520 TabIndex = 2 Top = 960 Width = 1215 @@ -481,7 +468,7 @@ Begin VB.Label lblDays Caption = "days" Height = 255 - Left = 2640 + Left = -72360 TabIndex = 42 Top = 1890 Width = 1335 @@ -489,7 +476,7 @@ Begin VB.Label lblExpiry Caption = "Expires after:" Height = 255 - Left = 120 + Left = -74880 TabIndex = 41 Top = 1850 Width = 1335 @@ -497,7 +484,7 @@ Begin VB.Label Label10 Caption = " Version:" Height = 255 - Left = 120 + Left = -74880 TabIndex = 39 Top = 720 Width = 1335 @@ -505,7 +492,7 @@ Begin VB.Label Label9 Caption = "Software Name:" Height = 255 - Left = 120 + Left = -74880 TabIndex = 37 Top = 480 Width = 1335 @@ -513,7 +500,7 @@ Begin VB.Label Label3 Caption = "License Class:" Height = 255 - Left = 120 + Left = -74880 TabIndex = 6 Top = 2130 Width = 1335 @@ -521,7 +508,7 @@ Begin VB.Label Label2 Caption = "License Type:" Height = 255 - Left = 120 + Left = -74880 TabIndex = 5 Top = 1560 Width = 1335 @@ -529,7 +516,7 @@ Begin VB.Label Label1 Caption = " Code:" Height = 255 - Left = 120 + Left = -74880 TabIndex = 1 Top = 960 Width = 1335 @@ -575,7 +562,7 @@ '' ' This test app is used to exercise all functionalities of ActiveLock. ' -' @author th...@us... +' @author th2tran ' @version 2.0.0 ' @date 20030715 @@ -583,8 +570,10 @@ ' / MODULE TO DO LIST / ' /////////////////////////////////////////////////////////////////////// ' -' [ ] Add some TODO items here -' +' [ ] Re: GetMACAndUserFromRequestCode(), try to move the decoding of the +' request code inside ActiveLock. We need to abstract this, if possible, +' such that the client app doesn't need to understand how the request +' code was encoded. ' ' /////////////////////////////////////////////////////////////////////// ' / MODULE CHANGE LOG / @@ -721,7 +710,7 @@ Set Lic = ActiveLock2.CreateProductLicense(txtName, txtSoftwareCodePub, _ txtVersion, MyActiveLock.LockType, MyActiveLock.LicenseType, strUser, strExpire) Dim strLic As String * 2048 - strLic = Lic.ToString() & vbLf & strMAC + strLic = MyActiveLock.GetLockString(Lic) ' encrypt using public key so that only us can decrypt it later strLic = modMain.Encrypt(strLic) txtLibKey = strLic @@ -747,7 +736,7 @@ Private Function IndexOf(Str As String, char As Byte) As Integer IndexOf = -1 - On Error GoTo ErrHandler + On Error GoTo errHandler Dim arrBytes() As Byte arrBytes = StrConv(Str, vbFromUnicode) Dim I% @@ -758,31 +747,31 @@ End If Next Exit Function -ErrHandler: +errHandler: ' return -1 End Function Private Sub cmdRegister_Click() - On Error GoTo ErrHandler + On Error GoTo errHandler ' TODO: Register this key Dim Lic As ActiveLock2.ProductLicense Set Lic = ActiveLock2.CreateProductLicense(txtName, txtSoftwareCodePub, txtVersion, _ MyActiveLock.LockType, MyActiveLock.LicenseType, _ - txtUser, GetExpirationDate(), txtLibKey) + txtUser, GetExpirationDate(), txtLibKeyIn) MyActiveLock.Register Lic MsgBox "Registration successful!" Exit Sub -ErrHandler: +errHandler: MsgBox Err.Number & ": " & Err.Description End Sub Private Sub cmdReqGen_Click() ' Generate Request code to MAC Address ' TODO: Handle other possibilities (Windows serial, etc...) - Dim strReq As String, strMAC As String - strMAC = modMACAddress.GetMACAddress() + Dim strReq As String, strLock As String + strLock = MyActiveLock.GetLockString() ' combine with user name - strReq = strMAC & vbLf & txtUser + strReq = strLock & vbLf & txtUser ' encrypt using our public key so that only us can decrypt it strReq = modMain.Encrypt(strReq) txtReqCodeGen = strReq @@ -826,11 +815,12 @@ txtRegStatus = "Registered" txtUsedDays = MyActiveLock.UsedDays txtExpiration = MyActiveLock.RegisteredDate - FunctionalitiesEnabled = False + FunctionalitiesEnabled = True Exit Sub NotRegistered: MsgBox Err.Number & ": " & Err.Description txtRegStatus = "Not Registered" + FunctionalitiesEnabled = False End Sub Private Property Let FunctionalitiesEnabled(flag As Boolean) |