I am using this code which should open a encrypted file, decrypt it and then decrypt the data inside it to reveal a serverID/Domain
What is wrong as this isnt doing anything, its not showing the domain in the box like it should
Jonathan
Code:
Sub ConvertSerial()
Dim ch As Char
Dim strCode As String
Dim Code, Number As Short
Dim Decrypt As String = ""
Dim inbox As String
Dim path As String
path = System.Windows.Forms.Application.StartupPath & "\data002.cde"
If path <> "" Then
Try open file and trap any errors using handler
strCode = 4712
If strCode = "" Then Exit Sub if cancel clicked
Code = CShort(strCode)
FileOpen(1, path, OpenMode.Input)
Do Until EOF(1) read lines from file
Input(1, Number) read encrypted numbers
ch = Chr(Number Xor Code) convert with Xor
Decrypt = Decrypt & ch and build string
Loop
Serial = Decrypt then display converted string
Catch
Finally
FileClose(1) close file
End Try
End If
Decrypt = ""
path = Serial
If path <> "" Then
Try open file and trap any errors using handler
strCode = 4712
If strCode = "" Then Exit Sub if cancel clicked
Code = CShort(strCode)
FileOpen(1, path, OpenMode.Input)
Do Until EOF(1) read lines from file
Input(1, Number) read encrypted numbers
ch = Chr(Number Xor Code) convert with Xor
Decrypt = Decrypt & ch and build string
Loop
frmAbout.txtServerID.Text = Decrypt then display converted string
Catch
Finally
FileClose(1) close file
End Try
End If
End Sub
What is wrong as this isnt doing anything, its not showing the domain in the box like it should
Jonathan