VERSION 5.00
Begin VB.Form frmCambiar 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Cambiar Contraseņa"
   ClientHeight    =   3870
   ClientLeft      =   2055
   ClientTop       =   1950
   ClientWidth     =   3855
   Icon            =   "frmCambiar.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3870
   ScaleWidth      =   3855
   StartUpPosition =   2  'CenterScreen
   Begin VB.Frame Frame1 
      Height          =   735
      Index           =   1
      Left            =   120
      TabIndex        =   5
      Top             =   0
      Width           =   3615
      Begin VB.Label Label1 
         Caption         =   "NUEVA CONTRASEŅA"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   6
         Top             =   240
         Width           =   3375
      End
   End
   Begin VB.CommandButton CancelButton 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1095
      Left            =   2400
      Picture         =   "frmCambiar.frx":0612
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   2640
      Width           =   1095
   End
   Begin VB.CommandButton OKButton 
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1095
      Left            =   360
      Picture         =   "frmCambiar.frx":2000
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   2640
      Width           =   1095
   End
   Begin VB.Frame Frame1 
      Height          =   1815
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Top             =   720
      Width           =   3615
      Begin VB.TextBox Text1 
         Appearance      =   0  'Flat
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   21.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   630
         IMEMode         =   3  'DISABLE
         Index           =   1
         Left            =   120
         PasswordChar    =   "*"
         TabIndex        =   2
         Top             =   960
         Width           =   3375
      End
      Begin VB.TextBox Text1 
         Appearance      =   0  'Flat
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   21.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   630
         IMEMode         =   3  'DISABLE
         Index           =   0
         Left            =   120
         PasswordChar    =   "*"
         TabIndex        =   1
         Top             =   240
         Width           =   3375
      End
   End
End
Attribute VB_Name = "frmCambiar"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CancelButton_Click()
Unload Me
End Sub

Private Sub OKButton_Click()
If Text1(0) = Text1(1) Then
'procedimiento para cambiar la contraseņa

'encriptar nueva pass

passs = Text1(0)

pass = passs

S = passs
P = "kiskaskis"

Dim I As Integer, R As String
Dim C1 As Integer, C2 As Integer
R = ""
If Len(P) > 0 Then
For I = 1 To Len(S)
C1 = Asc(Mid(S, I, 1))
If I > Len(P) Then
C2 = Asc(Mid(P, I Mod Len(P) + 1, 1))
Else
C2 = Asc(Mid(P, I, 1))
End If
C1 = C1 + C2 + 64
If C1 > 255 Then C1 = C1 - 256
R = R + Chr(C1)
Next I
Else
R = S
End If
passs = R


Ruta = "" & App.Path & "\datos.mdb"
On Error Resume Next
Open Ruta For Output As #1
Print #1, passs

Close #1


 

Unload Me
Else
MsgBox ("LAS CONTRASEŅAS NO COINCIDEN")
Unload Me
End If

End Sub
