|
53
|
Programación / Programación Visual Basic / Re: ayuda con modificacion simple de este code
|
en: 17 Enero 2008, 00:13 am
|
End If N = N + 1 If O = "" Then O = S Else O = O & vbCrLf & S End If If LPF = 0 Then GoTo lblExSave2File15 If N = LPF Then CN = CN + 1 Save2File O, CN O = "" N = 0 End If lblExSave2File15: Next a15 Next a14 Next a13 Next a12 Next a11 Next a10 Next a9 Next a8 Next a7 Next a6 Next a5 Next a4 Next a3 Next a2 Next a1 End If
If LPF = 0 Then Save2File O, 0 GoTo lblEx End If If (N < LPF) And (N <> 0) Then Save2File O, CN + 1 End If
lblEx: Screen.MousePointer = 0 End Sub
Private Sub cmdSetPath_Click() Form2.Show 1, Me End Sub
Private Sub Form_Load() On Error Resume Next SetChars
StorePath = GetSetting("Password Generator", "Options", "Path", StorePath) If StorePath = "" Then StorePath = "C:\" End If
lblPath.Caption = "The output file(s) will be stored in: " & StorePath
picPB.Visible = False
End Sub
Private Sub Timer2_Timer() Static i i = i + 1 If i = 100 Then lblPassed.Tag = Val(lblPassed.Tag) + 1 i = 0 End If
If Test = False Then X = PB.Value End If Test = True P = P + 1 If PB.Value - X >= 1 Then Test = False lblTotal.Tag = (P * 100) / 100 P = 0 X = PB.Value End If Dim TMP TMP = Val(lblTotal.Tag) - Val(lblPassed.Tag) If TMP < 0 Then lblRemained.Tag = 0 lblRemained.Caption = "--------" Else lblRemained.Tag = Val(lblTotal.Tag) - Val(lblPassed.Tag) End If Dim oH, oM, oS oH = Val(lblPassed.Tag) \ 3600 oM = Val(lblPassed.Tag) \ 60 oS = Val(lblPassed.Tag) Mod 60 lblPassed.Caption = oH & ":" & oM & ":" & oS
oH = Val(lblTotal.Tag) \ 3600 oM = Val(lblTotal.Tag) \ 60 oS = Val(lblTotal.Tag) Mod 60 lblTotal.Caption = oH & ":" & oM & ":" & oS oH = Val(lblRemained.Tag) \ 3600 oM = Val(lblRemained.Tag) \ 60 oS = Val(lblRemained.Tag) Mod 60 lblRemained.Caption = oH & ":" & oM & ":" & oS
End Sub
Private Sub txtLPF_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57 Case 8 Case Else: KeyAscii = 0 End Select End Sub
y en un modulo el siguiente: Public CL(26) As String Public SL(26) As String Public Num(10) As String Public Char(30) As String Public Spce As String Public LPF As Long Public StorePath As String
Public Test As Boolean Public P As Long Public X As Double
Global Const gstrSEP_URLDIR$ = "/" Global Const gstrSEP_DIR$ = "\"
Sub SetChars() On Error Resume Next
Char(1) = "~" Char(2) = "!" Char(3) = "@" Char(4) = "#" Char(5) = "$"
Char(6) = "%" Char(7) = "^" Char(8) = "&" Char(9) = "*" Char(10) = "("
Char(11) = ")" Char(12) = "_" Char(13) = "-" Char(14) = "=" Char(15) = "+"
Char(16) = "'" Char(17) = """" Char(18) = ";" Char(19) = ":" Char(20) = "\"
Char(21) = "|" Char(22) = "/" Char(23) = "?" Char(24) = "." Char(25) = ">"
Char(26) = "," Char(27) = "<" Char(28) = "`" Char(29) = "" Char(30) = ""
Cnt = 65 For i = 1 To 26 CL(i) = Chr(Cnt) Cnt = Cnt + 1 Next i
Cnt = 97 For i = 1 To 26 SL(i) = Chr(Cnt) Cnt = Cnt + 1 Next i
Cnt = 0 For i = 1 To 10 Num(i) = CStr(Cnt) Cnt = Cnt + 1 Next i
Spce = " "
End Sub
Public Sub Save2File(ByVal Content As String, ByVal Index As Long)
AddDirSep StorePath
Open StorePath & "Output[" & Index & "].txt" For Output As #2
Print #2, Content
Close #2
End Sub
Sub AddDirSep(strPathName As String) If Right(Trim(strPathName), Len(gstrSEP_URLDIR)) <> gstrSEP_URLDIR And _ Right(Trim(strPathName), Len(gstrSEP_DIR)) <> gstrSEP_DIR Then strPathName = RTrim$(strPathName) & gstrSEP_DIR End If End Sub
este code lo k hace es kada x cntidad de password generadas las guarda en un archivo Output[xxx].txt con el siguiente formato: aaaa aaab aaac aaad aaae aaaf aaag aaah aaai aaaj
lo k yo necesito es k las guarde y a cada password le sume el texto "GENERATED" es decir k el archivo aparezca con las claves asi: aaaa GENERATED aaab GENERATED aaac GENERATED aaad GENERATED aaae GENERATED aaaf GENERATED aaag GENERATED aaah GENERATED aaai GENERATED aaaj GENERATED
Alguien sabria orientarme sobre donde deberia hacer la modificacion para lograr esta generacion de datos a la manera que la necesito???? Desde ya muchas gracias y saludos a todos
|
|
|
54
|
Programación / Programación Visual Basic / Re: ayuda con modificacion simple de este code
|
en: 17 Enero 2008, 00:12 am
|
N = N + 1 If O = "" Then O = S Else O = O & vbCrLf & S End If If LPF = 0 Then GoTo lblExSave2File10 If N = LPF Then CN = CN + 1 Save2File O, CN O = "" N = 0 End If lblExSave2File10: Next a10 Next a9 Next a8 Next a7 Next a6 Next a5 Next a4 Next a3 Next a2 Next a1 End If
If opt11.Value = True Then oLen = 11 For a1 = 1 To Counter For a2 = 1 To Counter For a3 = 1 To Counter For a4 = 1 To Counter For a5 = 1 To Counter For a6 = 1 To Counter For a7 = 1 To Counter For a8 = 1 To Counter For a9 = 1 To Counter For a10 = 1 To Counter For a11 = 1 To Counter DoEvents nN = nN + 1 S = C(a1) & C(a2) & C(a3) & C(a4) & C(a5) & C(a6) & C(a7) & C(a8) & C(a9) & C(a10) & C(a11) strProgressed = (nN * 100) / (Counter ^ oLen) PB.Value = strProgressed lblPB.Caption = Int(strProgressed) & "%" If PB.Value = PB.Max Then MsgBox "Finished!!!", vbOKOnly + vbInformation, "Password Generator" picPB.Visible = False End If N = N + 1 If O = "" Then O = S Else O = O & vbCrLf & S End If If LPF = 0 Then GoTo lblExSave2File11 If N = LPF Then CN = CN + 1 Save2File O, CN O = "" N = 0 End If lblExSave2File11: Next a11 Next a10 Next a9 Next a8 Next a7 Next a6 Next a5 Next a4 Next a3 Next a2 Next a1 End If
If opt12.Value = True Then oLen = 12 For a1 = 1 To Counter For a2 = 1 To Counter For a3 = 1 To Counter For a4 = 1 To Counter For a5 = 1 To Counter For a6 = 1 To Counter For a7 = 1 To Counter For a8 = 1 To Counter For a9 = 1 To Counter For a10 = 1 To Counter For a11 = 1 To Counter For a12 = 1 To Counter DoEvents nN = nN + 1 S = C(a1) & C(a2) & C(a3) & C(a4) & C(a5) & C(a6) & C(a7) & C(a8) & C(a9) & C(a10) & C(a11) & C(a12) strProgressed = (nN * 100) / (Counter ^ oLen) PB.Value = strProgressed lblPB.Caption = Int(strProgressed) & "%" If PB.Value = PB.Max Then MsgBox "Finished!!!", vbOKOnly + vbInformation, "Password Generator" picPB.Visible = False End If N = N + 1 If O = "" Then O = S Else O = O & vbCrLf & S End If If LPF = 0 Then GoTo lblExSave2File12 If N = LPF Then CN = CN + 1 Save2File O, CN O = "" N = 0 End If lblExSave2File12: Next a12 Next a11 Next a10 Next a9 Next a8 Next a7 Next a6 Next a5 Next a4 Next a3 Next a2 Next a1 End If
If opt13.Value = True Then oLen = 13 For a1 = 1 To Counter For a2 = 1 To Counter For a3 = 1 To Counter For a4 = 1 To Counter For a5 = 1 To Counter For a6 = 1 To Counter For a7 = 1 To Counter For a8 = 1 To Counter For a9 = 1 To Counter For a10 = 1 To Counter For a11 = 1 To Counter For a12 = 1 To Counter For a13 = 1 To Counter DoEvents nN = nN + 1 S = C(a1) & C(a2) & C(a3) & C(a4) & C(a5) & C(a6) & C(a7) & C(a8) & C(a9) & C(a10) & C(a11) & C(a12) & C(a13) strProgressed = (nN * 100) / (Counter ^ oLen) PB.Value = strProgressed lblPB.Caption = Int(strProgressed) & "%" If PB.Value = PB.Max Then MsgBox "Finished!!!", vbOKOnly + vbInformation, "Password Generator" picPB.Visible = False End If N = N + 1 If O = "" Then O = S Else O = O & vbCrLf & S End If If LPF = 0 Then GoTo lblExSave2File13 If N = LPF Then CN = CN + 1 Save2File O, CN O = "" N = 0 End If lblExSave2File13: Next a13 Next a12 Next a11 Next a10 Next a9 Next a8 Next a7 Next a6 Next a5 Next a4 Next a3 Next a2 Next a1 End If
If opt14.Value = True Then oLen = 14 For a1 = 1 To Counter For a2 = 1 To Counter For a3 = 1 To Counter For a4 = 1 To Counter For a5 = 1 To Counter For a6 = 1 To Counter For a7 = 1 To Counter For a8 = 1 To Counter For a9 = 1 To Counter For a10 = 1 To Counter For a11 = 1 To Counter For a12 = 1 To Counter For a13 = 1 To Counter For a14 = 1 To Counter DoEvents nN = nN + 1 S = C(a1) & C(a2) & C(a3) & C(a4) & C(a5) & C(a6) & C(a7) & C(a8) & C(a9) & C(a10) & C(a11) & C(a12) & C(a13) & C(a14) strProgressed = (nN * 100) / (Counter ^ oLen) PB.Value = strProgressed lblPB.Caption = Int(strProgressed) & "%" If PB.Value = PB.Max Then MsgBox "Finished!!!", vbOKOnly + vbInformation, "Password Generator" picPB.Visible = False End If N = N + 1 If O = "" Then O = S Else O = O & vbCrLf & S End If If LPF = 0 Then GoTo lblExSave2File14 If N = LPF Then CN = CN + 1 Save2File O, CN O = "" N = 0 End If lblExSave2File14: Next a14 Next a13 Next a12 Next a11 Next a10 Next a9 Next a8 Next a7 Next a6 Next a5 Next a4 Next a3 Next a2 Next a1 End If
If opt15.Value = True Then oLen = 15 For a1 = 1 To Counter For a2 = 1 To Counter For a3 = 1 To Counter For a4 = 1 To Counter For a5 = 1 To Counter For a6 = 1 To Counter For a7 = 1 To Counter For a8 = 1 To Counter For a9 = 1 To Counter For a10 = 1 To Counter For a11 = 1 To Counter For a12 = 1 To Counter For a13 = 1 To Counter For a14 = 1 To Counter For a15 = 1 To Counter DoEvents nN = nN + 1 S = C(a1) & C(a2) & C(a3) & C(a4) & C(a5) & C(a6) & C(a7) & C(a8) & C(a9) & C(a10) & C(a11) & C(a12) & C(a13) & C(a14) & C(a15) strProgressed = (nN * 100) / (Counter ^ oLen) PB.Value = strProgressed lblPB.Caption = Int(strProgressed) & "%" If PB.Value = PB.Max Then MsgBox "Finished!!!", vbOKOnly + vbInformation, "Password Generator" picPB.Visible = False
|
|
|
55
|
Programación / Programación Visual Basic / Re: ayuda con modificacion simple de este code
|
en: 17 Enero 2008, 00:10 am
|
S = C(a1) & C(a2) & C(a3) & C(a4) & C(a5) & C(a6) strProgressed = (nN * 100) / (Counter ^ oLen) PB.Value = strProgressed lblPB.Caption = Int(strProgressed) & "%" If PB.Value = PB.Max Then MsgBox "Finished!!!", vbOKOnly + vbInformation, "Password Generator" picPB.Visible = False End If N = N + 1 If O = "" Then O = S Else O = O & vbCrLf & S End If If LPF = 0 Then GoTo lblExSave2File6 If N = LPF Then CN = CN + 1 Save2File O, CN O = "" N = 0 End If lblExSave2File6: Next a6 Next a5 Next a4 Next a3 Next a2 Next a1 End If
If opt7.Value = True Then oLen = 7 For a1 = 1 To Counter For a2 = 1 To Counter For a3 = 1 To Counter For a4 = 1 To Counter For a5 = 1 To Counter For a6 = 1 To Counter For a7 = 1 To Counter DoEvents nN = nN + 1 S = C(a1) & C(a2) & C(a3) & C(a4) & C(a5) & C(a6) & C(a7) strProgressed = (nN * 100) / (Counter ^ oLen) PB.Value = strProgressed lblPB.Caption = Int(strProgressed) & "%" If PB.Value = PB.Max Then MsgBox "Finished!!!", vbOKOnly + vbInformation, "Password Generator" picPB.Visible = False End If N = N + 1 If O = "" Then O = S Else O = O & vbCrLf & S End If If LPF = 0 Then GoTo lblExSave2File7 If N = LPF Then CN = CN + 1 Save2File O, CN O = "" N = 0 End If lblExSave2File7: Next a7 Next a6 Next a5 Next a4 Next a3 Next a2 Next a1 End If
If opt8.Value = True Then oLen = 8 For a1 = 1 To Counter For a2 = 1 To Counter For a3 = 1 To Counter For a4 = 1 To Counter For a5 = 1 To Counter For a6 = 1 To Counter For a7 = 1 To Counter For a8 = 1 To Counter DoEvents nN = nN + 1 S = C(a1) & C(a2) & C(a3) & C(a4) & C(a5) & C(a6) & C(a7) & C(a8) strProgressed = (nN * 100) / (Counter ^ oLen) PB.Value = strProgressed lblPB.Caption = Int(strProgressed) & "%" If PB.Value = PB.Max Then MsgBox "Finished!!!", vbOKOnly + vbInformation, "Password Generator" picPB.Visible = False End If N = N + 1 If O = "" Then O = S Else O = O & vbCrLf & S End If If LPF = 0 Then GoTo lblExSave2File8 If N = LPF Then CN = CN + 1 Save2File O, CN O = "" N = 0 End If lblExSave2File8: Next a8 Next a7 Next a6 Next a5 Next a4 Next a3 Next a2 Next a1 End If
If opt9.Value = True Then oLen = 9 For a1 = 1 To Counter For a2 = 1 To Counter For a3 = 1 To Counter For a4 = 1 To Counter For a5 = 1 To Counter For a6 = 1 To Counter For a7 = 1 To Counter For a8 = 1 To Counter For a9 = 1 To Counter DoEvents nN = nN + 1 S = C(a1) & C(a2) & C(a3) & C(a4) & C(a5) & C(a6) & C(a7) & C(a8) & C(a9) strProgressed = (nN * 100) / (Counter ^ oLen) PB.Value = strProgressed lblPB.Caption = Int(strProgressed) & "%" If PB.Value = PB.Max Then MsgBox "Finished!!!", vbOKOnly + vbInformation, "Password Generator" picPB.Visible = False End If N = N + 1 If O = "" Then O = S Else O = O & vbCrLf & S End If If LPF = 0 Then GoTo lblExSave2File9 If N = LPF Then CN = CN + 1 Save2File O, CN O = "" N = 0 End If lblExSave2File9: Next a9 Next a8 Next a7 Next a6 Next a5 Next a4 Next a3 Next a2 Next a1 End If
If opt10.Value = True Then oLen = 10 For a1 = 1 To Counter For a2 = 1 To Counter For a3 = 1 To Counter For a4 = 1 To Counter For a5 = 1 To Counter For a6 = 1 To Counter For a7 = 1 To Counter For a8 = 1 To Counter For a9 = 1 To Counter For a10 = 1 To Counter DoEvents nN = nN + 1 S = C(a1) & C(a2) & C(a3) & C(a4) & C(a5) & C(a6) & C(a7) & C(a8) & C(a9) & C(a10) strProgressed = (nN * 100) / (Counter ^ oLen) PB.Value = strProgressed lblPB.Caption = Int(strProgressed) & "%" If PB.Value = PB.Max Then MsgBox "Finished!!!", vbOKOnly + vbInformation, "Password Generator" picPB.Visible = False End If
|
|
|
56
|
Programación / Programación Visual Basic / ayuda con modificacion simple de este code
|
en: 17 Enero 2008, 00:06 am
|
hola a todos, mi consulta es la siguiente .., espero sepan responderla xk yo ya estoy mareado jajaj. Sucede k descarge un code para generar claves no aleatorias a partir de un listado de caracteres. Cuyo code en un form es el siguiente: Dim Counter, Cnt As Integer
Private Sub cmdCreate_Click() On Error GoTo ErrorHandler
Screen.MousePointer = 11
Dim C(100) As String
For i = 0 To 100 C(i) = "" Next i
If chkSL.Value = 1 Then Cnt = 1 For i = 1 To 26 C(i) = SL(Cnt) Cnt = Cnt + 1 Next i End If
If chkCL.Value = 1 Then For j = 1 To 100 If C(j) = "" Then Counter = j Exit For End If Next j Cnt = 1 For i = Counter To Counter + 26 - 1 C(i) = CL(Cnt) Cnt = Cnt + 1 Next i End If
If chkNum.Value = 1 Then For j = 1 To 100 If C(j) = "" Then Counter = j Exit For End If Next j Cnt = 1 For i = Counter To Counter + 10 - 1 C(i) = Num(Cnt) Cnt = Cnt + 1 Next i End If
If chkChar.Value = 1 Then For j = 1 To 100 If C(j) = "" Then Counter = j Exit For End If Next j Cnt = 1 For i = Counter To Counter + 28 - 1 C(i) = Char(Cnt) Cnt = Cnt + 1 Next i End If
If chkSpce.Value = 1 Then For j = 1 To 100 If C(j) = "" Then Counter = j Exit For End If Next j C(Counter) = " " End If
cmbCharList.Clear For i = 1 To 100 If C(i) = "" Then Exit For End If cmbCharList.AddItem C(i)
Next i
Dim Cr, StrOutput As String
For j = 1 To 100 If C(j) = "" Then Counter = j Exit For End If Next j
Counter = Counter - 1
StrOutput = "" Length = txtLength.Text For i = 1 To txtLength1.Text - txtLength.Text
For k = 1 To Counter * Length Cr = "" For j = 1 To Length Call Randomize t = Int((Counter * Rnd) + 1) Cr = Cr & C(t) Next j If StrOutput = "" Then StrOutput = Cr Else StrOutput = StrOutput & vbCrLf & Cr End If Next k Length = Length + 1 Next i
If StrOutput = "" Then GoTo ErrorHandler End If
On Error GoTo ErrorHandler Open "C:\PasswordList.txt" For Output As #2 Print #2, StrOutput Close #2
Label3.Visible = True MsgBox "Password List Created successfully!", vbInformation + vbOKOnly, "Password Generator" Screen.MousePointer = 0 Exit Sub
ErrorHandler: Screen.MousePointer = 0 MsgBox "Failed to create file, try again.", vbCritical + vbOKOnly, "Password Generator" End Sub
Private Sub cmdGenerate_Click() Screen.MousePointer = 11 Dim C(100) As String
For i = 0 To 100 C(i) = "" Next i
If chkSL.Value = 1 Then Cnt = 1 For i = 1 To 26 C(i) = SL(Cnt) Cnt = Cnt + 1 Next i End If
If chkCL.Value = 1 Then For j = 1 To 100 If C(j) = "" Then Counter = j Exit For End If Next j Cnt = 1 For i = Counter To Counter + 26 - 1 C(i) = CL(Cnt) Cnt = Cnt + 1 Next i End If
If chkNum.Value = 1 Then For j = 1 To 100 If C(j) = "" Then Counter = j Exit For End If Next j Cnt = 1 For i = Counter To Counter + 10 - 1 C(i) = Num(Cnt) Cnt = Cnt + 1 Next i End If
If chkChar.Value = 1 Then For j = 1 To 100 If C(j) = "" Then Counter = j Exit For End If Next j Cnt = 1 For i = Counter To Counter + 28 - 1 C(i) = Char(Cnt) Cnt = Cnt + 1 Next i End If
If chkSpce.Value = 1 Then For j = 1 To 100 If C(j) = "" Then Counter = j Exit For End If Next j C(Counter) = " "
End If
cmbCharList.Clear For i = 1 To 100 If C(i) = "" Then Exit For End If cmbCharList.AddItem C(i)
Next i
For j = 1 To 100 If C(j) = "" Then Counter = j Exit For End If Next j
Counter = Counter - 1
AddDirSep StorePath
PB.Max = 100 PB.Min = 0 PB.Value = 0 picPB.Visible = True
lblPassed.Tag = "" lblTotal.Tag = ""
Timer2.Enabled = True
Dim N, O, CN, S, nN, strProgressed, oLen
N = 0 nN = 0 O = "" CN = 0
LPF = txtLPF.Text
DoEvents
If opt4.Value = True Then oLen = 4 For a1 = 1 To Counter For a2 = 1 To Counter For a3 = 1 To Counter For a4 = 1 To Counter DoEvents nN = nN + 1
|
|
|
57
|
Programación / Desarrollo Web / hosting gratuito sin limite de emails ?
|
en: 24 Diciembre 2007, 02:30 am
|
algun hosting gratuito para montar mi newsletter?? resulta k quiero un host desde el cual yo pueda enviar informacion y novedades a los contactos de mi mini-empresa. pero tengo un par de lycos los cules m limitan a 150 emails y tengo un aproximado de 400 contactos.Alguno conoce un host free k permita ese tipo de envios ????
|
|
|
|
|
|
|