Kamis, 27 Juni 2013

Caesar Chiper

Design Form Sebagai Berikut :


listing Programnya:

Public Class Caesar_Chiper

    Private Sub enkripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles enkripsi.Click
        Dim x As String = ""

        Dim xkalimat As String = ""
        For i = 1 To Len(plainteks.Text)
            x = Mid(plainteks.Text, i, i)
            x = Chr(Asc(x) + 3)
            xkalimat = xkalimat + x
        Next
        chiperteks.Text = xkalimat
    End Sub

    Private Sub deskripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles deskripsi.Click
        Dim x As String = ""
        Dim xkalimat As String = ""
        For i = 1 To Len(chiperteks.Text)
            x = Mid(chiperteks.Text, i, i)
            x = Chr(Asc(x) - 3)
            xkalimat = xkalimat + x
        Next
        plainteks.Text = xkalimat
    End Sub

    Private Sub hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus.Click
        plainteks.Text = ""
        chiperteks.Text = ""
    End Sub

    Private Sub keluar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles keluar.Click
        Close()
    End Sub
End Class

dan Hasilnya:

0 komentar:

Posting Komentar

Template by:

Free Blog Templates