Nombre: zipear archivo contraseña dia juliano
Descripción:
para zipear archivos con las librerias ChilkatCrypt2.dll les envio el ejemplo que yo encontre referente a esto
URL: http://www.mygnet.net/codigos/vb/archivos_y_directorios/zipear_archivo_contrasenia_dia_juliano.1133
Código Fuente:
'IMPORTANTE DEBES CREAR UNOS ARCHIVOS CON NOMBRE PATH2.txt y
'PATH3.txt PARA QUE LEA LAS DIRECCIONES DONDE VA ATRAER LA INFORMACION
'ANALICENLO ES FACILISIMO
'SINO AVISENME
'EVALENZUELA_@HOTMAIL.COM
Dim serP As String
Dim serB As String
Dim serN As String
Dim serS As String
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
Dim zip As ChilkatZip2
Set zip = New ChilkatZip2
Set fs = CreateObject("Scripting.FileSystemObject")
Set Dato = fs.OpenTextFile(App.Path & "path2.txt")
Set dat = fs.OpenTextFile(App.Path & "path3.txt")
serP = Dato.Readline
serB = dat.Readline
'Text3.Text = serP & Text2.Text & ".txt"
zip.UnlockComponent "UnlockCode"
zip.NewZip "notUsed.zip"
'zip.AppendFiles "Sample/*", 1
zip.AppendFiles serP & Text2.Text & ".txt", 1
zip.Encryption = 1
zip.EncryptKeyLength = 256
zip.SetPassword Text1.Text
'MsgBox serB & Text2.Text & ".exe"
success = zip.WriteExe(serB & Text2.Text & ".exe")
If (success = 0) Then
MsgBox zip.LastErrorText
zip.SaveLastError "log.xml"
Else
Mailbox
MsgBox "Archivo Encriptado y Enviado", vbInformation, "Archivo zip " & Text2.Text & ".exe"
End If
End Sub
Private Sub Form_Load()
Dim SerG As String
Set T = CreateObject("Scripting.FileSystemObject")
Set Kl = T.OpenTextFile(App.Path & "Date.txt")
SerG = Kl.Readline
Set F = CreateObject("Scripting.FileSystemObject")
Set Dt = F.OpenTextFile(App.Path & "To.txt")
Set D = F.OpenTextFile(App.Path & "Cc.txt")
serN = Dt.Readline
serS = D.Readline
'Text1.Text = DateDiff("y", #12/31/2004#, Date)
Text1.Text = DateDiff("y", SerG, Date)
Text2.Text = Format(Date, "ddmmyy")
Text3.Text = serN
Text4.Text = serS
End Sub
Private Sub Mailbox()
Set F = CreateObject("Scripting.FileSystemObject")
Set Dt = F.OpenTextFile(App.Path & "To.txt")
Set D = F.OpenTextFile(App.Path & "Cc.txt")
serN = Dt.Readline
serS = D.Readline
Set ol = CreateObject("Outlook.Application")
Set Mail = ol.CreateItem(0)
Mail.to = serN
Mail.cc = serS
Mail.Subject = "Archivo de Chequeras del dia prueba " & Date
Mail.Body = ""
Mail.Attachments.Add (serB & Text2.Text & ".exe")
Mail.Send
ol.Quit
End Sub
Private Sub Label6_Click()
End Sub