Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[New\Source\Release] Binary Code <> English Converter [New\Source\Release]
#11
Well, nice one dear. I liked it and well done. Wish I cud give you some reputation ;)
Reply
#12
Great software. Maybe gonna try this. It should be useful.
Reply
#13
(04-17-2011, 12:15 AM)RDCA Wrote: How about both of you stop arguing. This isn't flame forums, its support forums. Now please start acting like it is. Oui

Pirate Oh shoot.. I thought I was logged in to another forum. Jk, I feel ya. I'm finished with my rant.
Reply
#14
It's not a proper binary converter as that would be impossible to create as every machine reads binary differently depending on their CPU.
Pointless program but nice release anyway.
[Image: burninglove4.png]
Reply
#15
Good stuff really useful i am using this.
Reply
#16
Here's my version:

[Image: Ukngi.png]

Full Codes:
Code:
Imports System.Text
Imports System.Text.RegularExpressions

Public Class Form1

    'String to Binary
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        RichTextBox2.Text = TextToBinary(RichTextBox1.Text)
    End Sub

    'Binary to string
    Private Sub Button6_Click(sender As System.Object, e As System.EventArgs) Handles Button6.Click
        RichTextBox1.Text = BinaryToText(RichTextBox2.Text)
    End Sub

    'Clear string to binary RichTextBox
    Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
        RichTextBox1.Clear()
    End Sub

    ''Clear binary to string RichTextBox
    Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
        RichTextBox2.Clear()
    End Sub

    'Clipboard string to binary RichTextBox
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        If RichTextBox1.SelectedText <> "" Then
            Clipboard.SetDataObject(RichTextBox1.SelectedText)
        End If
    End Sub

    'Clipboard binary to string RichTextBox
    Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click
        If RichTextBox2.SelectedText <> "" Then
            Clipboard.SetDataObject(RichTextBox2.SelectedText)
        End If
    End Sub

    'Only allow 0 and 1 in binary to string RichTextBox
    Private Sub RichTextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles RichTextBox2.KeyPress
        If e.KeyChar < "0" Or e.KeyChar > "1" Then
            MessageBox.Show("Only binary digits allowed.")
            e.Handled = True
        Else
            RichTextBox1.Text = BinaryToText(RichTextBox2.Text)
        End If
    End Sub

    ' Conversion to Binary
    Private Shared Function TextToBinary(ByVal Text As String, Optional ByVal Separator As String = " ") As String
        Try
            Dim oReturn As New StringBuilder
            ' Convert to ASCII and go through all the bytes
            For Each Character As Byte In ASCIIEncoding.ASCII.GetBytes(Text)
                oReturn.Append(Convert.ToString(Character, 2).PadLeft(8, "0"))
                oReturn.Append(Separator)
            Next
            Return oReturn.ToString
        Catch ex As Exception
            Return ex.Message
        End Try
    End Function

    'Conversion to Text
    Private Shared Function BinaryToText(ByVal BinaryText As String) As String
        Try
            Dim Characters As String = Regex.Replace(BinaryText, "[^01]", "")
            Dim ByteArray((Characters.Length / 8) - 1) As Byte
            ' Retrieve the original byte array
            For Index As Integer = 0 To ByteArray.Length - 1
                ByteArray(Index) = Convert.ToByte(Characters.Substring(Index * 8, 8), 2)
            Next
            ' Convert the ASCII-array to a Unicode string
            Return ASCIIEncoding.ASCII.GetString(ByteArray)
        Catch ex As Exception
            Return ex.Message
        End Try
    End Function
End Class

The cleaner, the better.
USB Anti-virus? Try USB Drive Defender
[Image: 8bQCusS.jpg]
Reply
#17
(05-15-2011, 04:52 AM)euverve Wrote: Here's my version:

[Image: Ukngi.png]

Full Codes:
Code:
Imports System.Text
Imports System.Text.RegularExpressions

Public Class Form1

    'String to Binary
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        RichTextBox2.Text = TextToBinary(RichTextBox1.Text)
    End Sub

    'Binary to string
    Private Sub Button6_Click(sender As System.Object, e As System.EventArgs) Handles Button6.Click
        RichTextBox1.Text = BinaryToText(RichTextBox2.Text)
    End Sub

    'Clear string to binary RichTextBox
    Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
        RichTextBox1.Clear()
    End Sub

    ''Clear binary to string RichTextBox
    Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
        RichTextBox2.Clear()
    End Sub

    'Clipboard string to binary RichTextBox
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        If RichTextBox1.SelectedText <> "" Then
            Clipboard.SetDataObject(RichTextBox1.SelectedText)
        End If
    End Sub

    'Clipboard binary to string RichTextBox
    Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click
        If RichTextBox2.SelectedText <> "" Then
            Clipboard.SetDataObject(RichTextBox2.SelectedText)
        End If
    End Sub

    'Only allow 0 and 1 in binary to string RichTextBox
    Private Sub RichTextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles RichTextBox2.KeyPress
        If e.KeyChar < "0" Or e.KeyChar > "1" Then
            MessageBox.Show("Only binary digits allowed.")
            e.Handled = True
        Else
            RichTextBox1.Text = BinaryToText(RichTextBox2.Text)
        End If
    End Sub

    ' Conversion to Binary
    Private Shared Function TextToBinary(ByVal Text As String, Optional ByVal Separator As String = " ") As String
        Try
            Dim oReturn As New StringBuilder
            ' Convert to ASCII and go through all the bytes
            For Each Character As Byte In ASCIIEncoding.ASCII.GetBytes(Text)
                oReturn.Append(Convert.ToString(Character, 2).PadLeft(8, "0"))
                oReturn.Append(Separator)
            Next
            Return oReturn.ToString
        Catch ex As Exception
            Return ex.Message
        End Try
    End Function

    'Conversion to Text
    Private Shared Function BinaryToText(ByVal BinaryText As String) As String
        Try
            Dim Characters As String = Regex.Replace(BinaryText, "[^01]", "")
            Dim ByteArray((Characters.Length / 8) - 1) As Byte
            ' Retrieve the original byte array
            For Index As Integer = 0 To ByteArray.Length - 1
                ByteArray(Index) = Convert.ToByte(Characters.Substring(Index * 8, 8), 2)
            Next
            ' Convert the ASCII-array to a Unicode string
            Return ASCIIEncoding.ASCII.GetString(ByteArray)
        Catch ex As Exception
            Return ex.Message
        End Try
    End Function
End Class

The cleaner, the better.

Looks good bro. I will test it later on. Good looking gui.

@OP Yours looks good too.
[Image: haloabtractc4d.png]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] Guidtech [Better then HWID][WITH VB FILES!] The-One 5 6,612 08-07-2015, 06:18 AM
Last Post: darknessxk
  [Source] Proxy Grabber [Cool] Hell Guardian 12 8,363 04-07-2015, 11:46 AM
Last Post: polas
  [SOURCE] Advanced Webcam Viewer TalishHF 4 3,441 08-25-2014, 01:20 AM
Last Post: dark_move
  [Source] Deep Freeze Pass Reader for 7.10.020.3176 euverve 6 6,055 01-02-2014, 09:07 PM
Last Post: idrcelab
  [Release] Password Enhancer v1.0 [/Release] Resistance 11 5,125 09-29-2013, 08:58 PM
Last Post: Resistance

Forum Jump:


Users browsing this thread: 1 Guest(s)