Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 01:42

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Dateien-verschlüsslungsproblem

Discussion on Dateien-verschlüsslungsproblem within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2012
Posts: 1
Received Thanks: 0
Dateien-verschlüsslungsproblem

hallo zusammen, ich habe mich vor 10 min angemeldet nur um eine lösund für mein problem zufinden:

ich habe in visualbasic 2010 ein tool gecodet, welches man daten in einer listbox reinziehen kann (nur die fateiname z.B.: brain.exe)
, in einer anderen textbox steht der Datei pfad (C:\users\basti\desktop\)

in textbox2 steht das zielspeicherpfad (C:\users\basti\desktop)
zeile steht für jedes item in meiner listbox, ich machs mit for each schleife..

mein problem ist jetzt nur das er mir das brav verschlüsselt, aber beim entschlüsseln er mir dateien ohne endung erstellt, die kann ich aber sobald ich manuel die endung definiert habe wieder öffnen..

Verschlüsseln, klappt ja soweit..
PHP Code:
Private Sub Button1_Click(sender As System.ObjectAs System.EventArgsHandles Button1.Click

        
If System.IO.Directory.Exists(TextBox2.Text) = False Then
            System
.IO.Directory.CreateDirectory(TextBox2.Text)
            If 
txtpassword.Text "" Then
                MsgBox
("Bitte Passwort eingeben"vbInformation"Passwort Fehlerhaft")
            Else
                Try
                    For 
Each Zeile As String In ListBox1.Items
                        
If System.IO.Directory.Exists(TextBox1.Text "\" + Zeile) = False Then
                            _crypto = New CryptoLib.Crypto
                            _crypto.EncryptFile(TextBox1.Text + "
\" + Zeile,
 '## hier wird verschlüsselt 
TextBox2.Text + "
\" + Zeile + ".axc3", Me.txtpassword.Text)
                            Application.DoEvents()
                        Else
                            _crypto = New CryptoLib.Crypto
                            _crypto.EncryptFile(TextBox1.Text + "
\" + Zeile,
 '## hier wird verschlüsselt
TextBox2.Text + "
\" + Zeile + ".axc3", Me.txtpassword.Text)
                            Application.DoEvents()
                        End If
                    Next
                Catch ex As Exception
                    MessageBox.Show(ex.Message, "
Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                Finally
                    If Not _crypto Is Nothing Then _crypto.Dispose()
                End Try
            End If
        Else
            If txtpassword.Text = "" Then
                MsgBox("
Bitte Passwort eingeben", vbInformation, "Passwort Fehlerhaft")
            Else
                Try
                    For Each Zeile As String In ListBox1.Items
                        If System.IO.Directory.Exists(TextBox1.Text + "
\" +
 '## hier wird verschlüsselt 
Zeile) = False Then
                            _crypto = New CryptoLib.Crypto
                            _crypto.EncryptFile(TextBox1.Text + "
\" + Zeile, TextBox2.Text + "\" + Zeile + ".axc3", Me.txtpassword.Text)
                            Application.DoEvents()
                        Else
                            _crypto = New CryptoLib.Crypto
                            _crypto.EncryptFile(TextBox1.Text + "
\" + Zeile, 
 '## hier wird verschlüsselt
TextBox2.Text + "
\" + Zeile + ".axc3", Me.txtpassword.Text)
                            Application.DoEvents()
                        End If
                    Next
                Catch ex As Exception
                    MessageBox.Show(ex.Message, "
Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                Finally
                    If Not _crypto Is Nothing Then _crypto.Dispose()
                End Try
            End If
        End If
    End Sub 



enschtlüsseln:
PHP Code:
 Private Sub Button2_Click(sender As System.ObjectAs System.EventArgsHandles Button2.Click
        
If System.IO.Directory.Exists(TextBox2.Text) = False Then
            System
.IO.Directory.CreateDirectory(TextBox2.Text)
            
Application.DoEvents()
            If 
txtpassword.Text "" Then
                MsgBox
("Bitte Passwort eingeben"vbInformation"Passwort Fehlerhaft")
            
End If
            For 
Each Zeile As String In ListBox1.Items
                Dim quelle 
As String TextBox1.Text "\" + Zeile.ToString
                Dim speicherort As String = TextBox2.Text + "
\" + Zeile.ToString

                If System.IO.Directory.Exists(speicherort) = False Then



                    _crypto = New CryptoLib.Crypto
                    _crypto.DecryptFile(quelle, speicherort.Substring(0, quelle.Length - 4), Me.txtpassword.Text)

 '## hier wird wieder entschlüsselt
                Else
                    _crypto = New CryptoLib.Crypto
                    _crypto.DecryptFile(quelle, speicherort.Substring(0, quelle.Length - 4), Me.txtpassword.Text)
                End If
            Next
            If Not _crypto Is Nothing Then _crypto.Dispose()
        Else
            If Not _crypto Is Nothing Then _crypto.Dispose()
            ' MessageBox.Show(ex.Message, "
Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If

    End Sub 
für gedankenanstöße oder hilfeleistung bin ich sehr dankbar, ich lass mich gerne von jemand höheren belehren
basti123sdf is offline  
Old 10/25/2012, 23:55   #2
 
elite*gold: 0
Join Date: Jul 2012
Posts: 284
Received Thanks: 127
Dim Path As String = "C:\Users\Basti\Text.txt.axc3"
Dim SplitFileName As Object = Path.Split(".axc3")
Dim Result As String = SplitFileName(0)

Result ist gleich der richtige Dateiname... Hierbei kann es zu einem Fehler kommen, sofern der Dateiname ein .axc3 enthält, außer die Dateiendung. Ist aber eher unwahrscheinlich... Man kann aber eine Überprüfung einbauen.
3Angle is offline  
Reply


Similar Threads Similar Threads
[Release] How to pyc dateien simpel in py dateien converten
02/13/2012 - Metin2 PServer Guides & Strategies - 20 Replies
Hey. Um der Section nochmal richtig schön eins reinzuwürgen hab ich mich entschlossen leuten wie passy und RealFreak mal zu zeigen wie einfach es ist ihre "sicheren" pyc dateien in simplen Python Source umzuwandeln. DePython datei dort hochladen ----> man lädt die py datei mit dem source darin herunter---> fertig Und ja ich bin weg aus der Section nur find ichs witzig wie sie alle meinen ihre pyc helfen ihre dateien zu schützen. @ Haters und Flamers: viel spaß beim nerven, ich...
Brauche Dateien für EP1 Client!! Diese Mob dateien
11/14/2011 - Last Chaos - 4 Replies
€: YANNIKIN BITTE NICHT CLOSEN FUNKT WIEDER NICHT !!! Ja also brauche diese dateien von Paain´s EP1 Client die sind bei mir irgendwie immer beschädigt...:mad: Lange Rede kurzer Sinn Brauche diese Dateien : "mobAll_usa.lod" "mobname_usa.lod" Gibt natürlich Thx :D :handsdown: :handsdown:



All times are GMT +2. The time now is 01:42.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.