0
comments
Posted in
Labels:
Kuliah
- Mata kuliah Pemrograman Visual Dengan Pak Mesran
2.Kriptografi
1.Manajemen Sistem Informasi
2.Manajemen Sistem Informasi
- Mata kuliah Rekayasa Perangkat Lunak Dengan Pak Harvei
1.Manajemen Sistem Informasi
2.Manajemen Sistem Informasi
0
comments
Posted in
Labels:
Kuliah
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
plainteks.Text = ""
chiperteks.Text = ""
End Sub
Private Sub Btnenkript_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnenkript.Click
Dim
jumlah As Double
= Len(plainteks.Text)
Dim x As String
Dim
xkalimat As String
= ""
Dim i As Double
Dim bil
As Integer
For i =
1 To jumlah
x = Mid(plainteks.Text, i, 1)
bil = Asc(x) + 3
x = Chr(bil)
xkalimat = xkalimat + x
Next i
chiperteks.Text = xkalimat
Private Sub Btnerase_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnerase.Click
chiperteks.Text = ""
plainteks.Text = ""
End Sub
End Class
Hasil :
- Chiperteks Caesar
Private Sub Btnenkrip_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnenkrip.Click
Dim x As String
Dim bil As Integer
Chiperteks.Text = ""
For i = 1 To Len(plainteks.Text)
x = Microsoft.VisualBasic.Mid(Plainteks.Text, i, 1)
bil = Asc(x)
bil = bil + 3 Mod 26
x = Chr(bil)
Chiperteks.Text = Chiperteks.Text & x
Next
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
chiperteks.Text = ""
plainteks.Text = ""
End Sub
Private Sub Btndeskrip_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btndeskrip.Click
Dim x As String
Dim bil As Integer
chiperteks.Text = ""
For i = 1 To Len(plainteks.Text)
x = Microsoft.VisualBasic.Mid(plainteks.Text, i, 1)
bil = Asc(x)
bil = bil - 3 Mod 26
x = Chr(bil)
chiperteks.Text = chiperteks.Text & x
Next
End Sub
End Class
- Vernam
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
plainteks.Text = ""
kunci.Text = ""
chiperteks.Text = ""
End Sub
Private Sub Btnenkript_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnenkript.Click
Dim j As Integer
Dim jum As Integer
Dim sKey As String
Dim nKata As Integer
Dim nKunci As Integer
Dim sKata As String
Dim sPlain As String = ""
Dim nEnc As Integer
j = 0
sKata = plainteks.Text
jum = Len(sKata)
sKey = kunci.Text
For i = 1 To jum
If j = Len(sKey) Then
j = 1
Else
j = j + 1
End If
nKata = Asc(Mid(sKata, i, 1)) - 65
nKunci = Asc(Mid(sKey, j, 1)) - 65
nEnc = ((nKata + nKunci) Mod 26)
sPlain = sPlain & Chr((nEnc) + 65)
Next i
chiperteks.Text = sPlain
End Sub
Private Sub plainteks_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles plainteks.KeyPress
e.KeyChar = UCase(e.KeyChar)
Dim tombol As Integer = Asc(e.KeyChar)
If Not (((tombol >= 65) And (tombol <= 90)) Or (tombol = 8)) Then
e.Handled = True
End If
End Sub
Private Sub kunci_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles kunci.KeyPress
e.KeyChar = UCase(e.KeyChar)
Dim tombol As Integer = Asc(e.KeyChar)
If Not (((tombol >= 65) And (tombol <= 90)) Or (tombol = 8)) Then
e.Handled = True
End If
End Sub
End Class
- Vigenere
Public Class Form4
Private Sub BtnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnProses.Click
chiperteks.Text = Enkripsi(plainteks.Text, kunci.Text)
End Sub
Function enkripsi(ByVal teks As String, ByVal kunci As String) As String
Dim a As Integer
Dim b As Integer
Dim sKey As String
Dim nKata As Integer
Dim nKunci As Integer
Dim sKata As String
Dim sPlain As String
Dim nEnc As Integer
a = 0
b = Len(teks)
sPlain = ""
sKey = kunci
sKata = teks
For i = 1 To b
If a = Len(sKey) Then
a = 1
Else
a = a + 1
End If
nKata = Asc(Mid(sKata, i, 1))
nKunci = Asc(Mid(sKey, a, 1))
nEnc = ((nKata + nKunci) Mod 256)
sPlain = sPlain & Chr((nEnc))
Next i
enkripsi = sPlain
End Function
Private Sub Btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnhapus.Click
plainteks.Text = ""
chiperteks.Text = ""
kunci.Text = ""
End Sub
Private Sub Btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkeluar.Click
Close()
End Sub
End Class
Private Sub BtnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnProses.Click
chiperteks.Text = Enkripsi(plainteks.Text, kunci.Text)
End Sub
Function enkripsi(ByVal teks As String, ByVal kunci As String) As String
Dim a As Integer
Dim b As Integer
Dim sKey As String
Dim nKata As Integer
Dim nKunci As Integer
Dim sKata As String
Dim sPlain As String
Dim nEnc As Integer
a = 0
b = Len(teks)
sPlain = ""
sKey = kunci
sKata = teks
For i = 1 To b
If a = Len(sKey) Then
a = 1
Else
a = a + 1
End If
nKata = Asc(Mid(sKata, i, 1))
nKunci = Asc(Mid(sKey, a, 1))
nEnc = ((nKata + nKunci) Mod 256)
sPlain = sPlain & Chr((nEnc))
Next i
enkripsi = sPlain
End Function
Private Sub Btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnhapus.Click
plainteks.Text = ""
chiperteks.Text = ""
kunci.Text = ""
End Sub
Private Sub Btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkeluar.Click
Close()
End Sub
End Class
Public Class Form5
Private Sub Btnenkript_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnenkript.Click
Dim x As String
Dim CI As Integer
chiperteks.Text = ""
For i = 1 To Len(plainteks.Text)
x = Microsoft.VisualBasic.Mid(plainteks.Text, i, 1)
CI = Asc(x)
CI = (plainteks.Text + kunci.Text) Mod 26
x = Chr(CI)
chiperteks.Text = chiperteks.Text & x
Next
chiperteks.Text = enkripsi(plainteks.Text, kunci.Text)
End Sub
Private Sub Btndeskript_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btndeskript.Click
Dim x As String
Dim CI As Integer
Dim KI As Integer
Dim PI As Integer
chiperteks.Text = ""
For i = 1 To Len(plainteks.Text)
x = Microsoft.VisualBasic.Mid(plainteks.Text, i, 1)
PI = Asc(x)
PI = (CI - KI) Mod 26
x = Chr(PI)
chiperteks.Text = chiperteks.Text & x
Next
End Sub
Function enkripsi(ByVal teks As String, ByVal kunci As String) As String
Dim a As Integer
Dim b As Integer
Dim sKey As String
Dim nKata As Integer
Dim nKunci As Integer
Dim sKata As String
Dim sPlain As String
Dim nEnc As Integer
a = 0
b = Len(teks)
sPlain = ""
sKey = kunci
sKata = teks
For i = 1 To b
If a = Len(sKey) Then
a = 1
Else
a = a + 1
End If
nKata = Asc(Mid(sKata, i, 1))
nKunci = Asc(Mid(sKey, a, 1))
nEnc = ((nKata + nKunci) Mod 26)
sPlain = sPlain & Chr((nEnc))
Next i
enkripsi = sPlain
End Function
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
chiperteks.Text = ""
plainteks.Text = ""
kunci.Text = ""
End Sub
End Class
Private Sub Btnenkript_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnenkript.Click
Dim x As String
Dim CI As Integer
chiperteks.Text = ""
For i = 1 To Len(plainteks.Text)
x = Microsoft.VisualBasic.Mid(plainteks.Text, i, 1)
CI = Asc(x)
CI = (plainteks.Text + kunci.Text) Mod 26
x = Chr(CI)
chiperteks.Text = chiperteks.Text & x
Next
chiperteks.Text = enkripsi(plainteks.Text, kunci.Text)
End Sub
Private Sub Btndeskript_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btndeskript.Click
Dim x As String
Dim CI As Integer
Dim KI As Integer
Dim PI As Integer
chiperteks.Text = ""
For i = 1 To Len(plainteks.Text)
x = Microsoft.VisualBasic.Mid(plainteks.Text, i, 1)
PI = Asc(x)
PI = (CI - KI) Mod 26
x = Chr(PI)
chiperteks.Text = chiperteks.Text & x
Next
End Sub
Function enkripsi(ByVal teks As String, ByVal kunci As String) As String
Dim a As Integer
Dim b As Integer
Dim sKey As String
Dim nKata As Integer
Dim nKunci As Integer
Dim sKata As String
Dim sPlain As String
Dim nEnc As Integer
a = 0
b = Len(teks)
sPlain = ""
sKey = kunci
sKata = teks
For i = 1 To b
If a = Len(sKey) Then
a = 1
Else
a = a + 1
End If
nKata = Asc(Mid(sKata, i, 1))
nKunci = Asc(Mid(sKey, a, 1))
nEnc = ((nKata + nKunci) Mod 26)
sPlain = sPlain & Chr((nEnc))
Next i
enkripsi = sPlain
End Function
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
chiperteks.Text = ""
plainteks.Text = ""
kunci.Text = ""
End Sub
End Class
1 comments
Posted in
Labels:
Kuliah
Berikut merupakan tugas pemrograman visual yang diberikan Pak Mesran, tentang listview ,
Public Class Form1
Sub
BUATTABLE()
LV.Columns.Add("NIK",
80, HorizontalAlignment.Center)
LV.Columns.Add("NAMA",
100, HorizontalAlignment.Left)
LV.Columns.Add("JABATAN",
60, HorizontalAlignment.Left)
LV.Columns.Add("GAJI",
60, HorizontalAlignment.Left)
LV.Columns.Add("STATUS",
60, HorizontalAlignment.Left)
LV.Columns.Add("TJN
KELUARGA", 60, HorizontalAlignment.Left)
LV.Columns.Add("PAJAK",
60, HorizontalAlignment.Left)
LV.Columns.Add("TOTAL
GAJI", 80, HorizontalAlignment.Left)
LV.View = View.Details
LV.GridLines = True
LV.FullRowSelect = True
End Sub
Sub
ISITABLE()
Dim LST
As New
ListViewItem
LST.Text = NIK.Text
LST.SubItems.Add(NAMA.Text)
LST.SubItems.Add(JABATAN.Text)
LST.SubItems.Add(GAJI.Text)
LST.SubItems.Add(STATUS.Text)
LST.SubItems.Add(TUNJ.Text)
LST.SubItems.Add(PAJAK.Text)
LST.SubItems.Add(TTL_GAJI.Text)
LV.Items.Add(LST)
End Sub
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
NIK.Items.Add("001")
NIK.Items.Add("002")
NIK.Items.Add("003")
JABATAN.Items.Add("MANDOR")
JABATAN.Items.Add("KEPALA BAGIAN")
JABATAN.Items.Add("STAF")
STATUS.Items.Add("Menikah")
STATUS.Items.Add("Belum Menikah")
BUATTABLE()
End Sub
Private Sub JABATAN_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
JABATAN.SelectedIndexChanged
Select Case JABATAN.Text
Case
"MANDOR" : GAJI.Text = 1750000
Case
"KEPALA BAGIAN" : GAJI.Text = 2500000
Case
"STAF" : GAJI.Text = 1250000
End Select
PAJAK.Text = 0.15 * GAJI.Text
End Sub
Private Sub NIK_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
NIK.SelectedIndexChanged
Select Case NIK.Text
Case
"001" : NAMA.Text = "Laila Nurli"
Case
"002" : NAMA.Text = "Ema Satriana"
Case
"003" : NAMA.Text = "Sri Wahyuningsih"
End Select
End Sub
Private Sub STATUS_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
STATUS.SelectedIndexChanged
Select Case STATUS.Text
Case
"Menikah" : TUNJ.Text = 0.15 *
GAJI.Text
Case
"Belum Menikah" : TUNJ.Text = 0
End Select
End Sub
Private Sub BTNPROSES_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BTNPROSES.Click
TTL_GAJI.Text = Val(GAJI.Text) +
Val(TUNJ.Text) - Val(PAJAK.Text)
ISITABLE()
NIK.Text = ""
NAMA.Text = ""
JABATAN.Text = ""
GAJI.Text = ""
STATUS.Text = ""
TUNJ.Text = ""
PAJAK.Text = ""
TTL_GAJI.Text = ""
End Sub
Private Sub BTNKELUAR_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BTNKELUAR.Click
Close()
End Sub
End Class
Hasil :
LISTVIEW II :
Public Class Form1
Sub
buattabel()
lv.Columns.Add("NPM",
80, HorizontalAlignment.Center)
lv.Columns.Add("Nama",
180, HorizontalAlignment.Left)
lv.View = View.Details
lv.GridLines = True
lv.FullRowSelect = True
End Sub
Sub
isitabel()
Dim lst
As New
ListViewItem
lst.Text = npm.Text
lst.SubItems.Add(nama.Text)
lv.Items.Add(lst)
End Sub
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
buattabel()
End Sub
Private Sub Btnsimpan_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnsimpan.Click
isitabel()
npm.Text = ""
nama.Text = ""
End Sub
End Class
Hasil :
LISTVIEW III :
Public Class Form2
Sub
buattabel()
lv.Columns.Add("NPM",
80, HorizontalAlignment.Center)
lv.Columns.Add("Nama",
180, HorizontalAlignment.Left)
lv.View = View.Details
lv.GridLines = True
lv.FullRowSelect = True
End Sub
Sub
isitabel()
Dim lst
As New
ListViewItem
lst.Text = npm.Text
lst.SubItems.Add(nama.Text)
lv.Items.Add(lst)
End Sub
Private Sub Form2_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
buattabel()
End Sub
Private Sub Btnsimpan_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnsimpan.Click
isitabel()
npm.Text = ""
nama.Text = ""
End Sub
Private Sub Btnhapussemua_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnhapussemua.Click
lv.Items.Clear()
End Sub
Private Sub Btnhapus_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnhapus.Click
lv.Items.Remove(lv.SelectedItems(0))
End Sub
End Class
Hasil :
Laila Nurli. Powered by Blogger.