A-1 LISTING PROGRAM. 1. Form1.cs. Universitas Sumatera Utara

Size: px
Start display at page:

Download "A-1 LISTING PROGRAM. 1. Form1.cs. Universitas Sumatera Utara"

Transcription

1 A-1 LISTING PROGRAM 1. Form1.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using IronPython.Hosting; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; using System.IO; using System.Diagnostics; using System.Windows.Forms; using System.Drawing; namespace program public partial class Form1 : Form public string imgpath; public string paddedimgpath; public string cipherteks; DateTime awal; DateTime akhir; TimeSpan total; public Form1() InitializeComponent(); private void button1_click(object sender, EventArgs e) DateTime awal; DateTime akhir; TimeSpan total; int waktupenyisipan; awal = DateTime.Now; if (ekskey.text == "" ekskey.text == " " ekskey.text == "enkripsi") MessageBox.Show("kunci tidak boleh kosong!", "Peringatan!", MessageBoxButtons.OK, MessageBoxIcon.Error); else Process p = new Process(); // create process (i.e., the python program p.startinfo.filename = "C:\\Python27\\python.exe"; p.startinfo.redirectstandardoutput = true; p.startinfo.useshellexecute = false; // make sure we can read the output from stdout p.startinfo.arguments = "internal_key.py " + ekskey.text; // start the python program with two parameters p.start(); // start the process (the python program) StreamReader s = p.standardoutput; String output = s.readtoend();

2 A-2 string[] r = output.split(new char[] ' ' ); // get the parameter string q = r[0]; //string[] words = q.split('.'); intkey.text = output; p.waitforexit(); akhir = DateTime.Now; total = akhir - awal; waktupenyisipan = Convert.ToInt32(total.TotalMilliseconds); MessageBox.Show("Waktu pembangkitan kunci adalah: " + waktupenyisipan + " ms."); private void button3_click(object sender, EventArgs e) DateTime awal; DateTime akhir; TimeSpan total; int waktupenyisipan; awal = DateTime.Now; Process p = new Process(); // create process (i.e., the python program p.startinfo.filename = "C:\\Python27\\python.exe"; p.startinfo.redirectstandardoutput = true; p.startinfo.useshellexecute = false; // make sure we can read the output from stdout p.startinfo.arguments = "enkripsi_pesan.py " + plaintext.text.replace(' ', '_') + " " + ekskey.text;// start the python program with two parameters p.start(); // start the process (the python program) StreamReader s = p.standardoutput; String output = s.readtoend(); string[] r = output.split(new char[] ' ' ); // get the parameter string q = r[0]; //string[] words = q.split('.'); ciphertext.text = output; cipherteks = output; p.waitforexit(); akhir = DateTime.Now; total = akhir - awal; waktupenyisipan = Convert.ToInt32(total.TotalMilliseconds); MessageBox.Show("Waktu enkripsi adalah: " + waktupenyisipan + " ms."); private void button2_click(object sender, EventArgs e) try plaintext.text=""; OpenFileDialog bukaplaintext = new OpenFileDialog(); bukaplaintext.initialdirectory = ""; bukaplaintext.filter = "File Text (*.txt) *.txt"; bukaplaintext.filterindex = 1; bukaplaintext.restoredirectory = true; if (DialogResult.OK == bukaplaintext.showdialog()) string baca_teks = "";

3 A-3 StreamReader objreader = new StreamReader(bukaPlainText.FileName); baca_teks = objreader.readline(); while (baca_teks!= null) plaintext.text += baca_teks; baca_teks = objreader.readline(); objreader.close(); catch (Exception ex) MessageBox.Show("Terjadi Kesalah pada \n- " + ex.tostring()); private void button5_click(object sender, EventArgs e) OpenFileDialog thedialog = new OpenFileDialog(); thedialog.title = "Open Image File"; thedialog.filter = "PNG(*.png) *.png"; thedialog.initialdirectory thedialog.showdialog(); if (thedialog.filename.tostring()!= "") Image image = Image.FromFile(theDialog.FileName.ToString()); picturebox1.sizemode = PictureBoxSizeMode.StretchImage; picturebox1.image = image; imgpath = thedialog.filename.tostring(); MessageBox.Show("Citra berhasil diimport!", "Informasi!", MessageBoxButtons.OK, MessageBoxIcon.Information); private void button14_click_1(object sender, EventArgs e) DateTime awal; DateTime akhir; TimeSpan total; int waktupenyisipan; awal = DateTime.Now; if (eksdek.text == "" eksdek.text == " " eksdek.text == "enkripsi") MessageBox.Show("kunci tidak boleh kosong!", "Peringatan!", MessageBoxButtons.OK, MessageBoxIcon.Error); else Process p = new Process(); // create process (i.e., the python program p.startinfo.filename = "C:\\Python27\\python.exe"; p.startinfo.redirectstandardoutput = true; p.startinfo.useshellexecute = false; // make sure we can read the output from stdout p.startinfo.arguments = "internal_key.py " + eksdek.text; // start the python program with two parameters p.start(); // start the process (the python program)

4 A-4 StreamReader s = p.standardoutput; String output = s.readtoend(); string[] r = output.split(new char[] ' ' ); // get the parameter string q = r[0]; //string[] words = q.split('.'); intdek.text= output; p.waitforexit(); p.waitforexit(); akhir = DateTime.Now; total = akhir - awal; waktupenyisipan = Convert.ToInt32(total.TotalMilliseconds); MessageBox.Show("Waktu pembangkitan kunci adalah: " + waktupenyisipan + " ms."); private void button12_click_1(object sender, EventArgs e) DateTime awal; DateTime akhir; TimeSpan total; int waktupenyisipan; awal = DateTime.Now; Process p = new Process(); // create process (i.e., the python program p.startinfo.filename = "C:\\Python27\\python.exe"; p.startinfo.redirectstandardoutput = true; p.startinfo.useshellexecute = false; // make sure we can read the output from stdout p.startinfo.arguments = "dekripsi_pesan.py " + imgpath + " " + eksdek.text;// start the python program with two parameters p.start(); // start the process (the python program) StreamReader s = p.standardoutput; String output = s.readtoend(); string[] r = output.split(new char[] ' ' ); // get the parameter string q = r[0]; //string[] words = q.split('.'); plaindek.text = output; p.close(); akhir = DateTime.Now; total = akhir - awal; waktupenyisipan = Convert.ToInt32(total.TotalMilliseconds); MessageBox.Show("Waktu dekripsi adalah: " + waktupenyisipan + " ms."); private void button6_click(object sender, EventArgs e) DateTime awal; DateTime akhir; TimeSpan total; int waktupenyisipan; awal = DateTime.Now; program Process p = new Process(); // create process (i.e., the python p.startinfo.filename = "C:\\Python27\\python.exe"; p.startinfo.redirectstandardoutput = true;

5 A-5 p.startinfo.useshellexecute = false; // make sure we can read the output from stdout p.startinfo.arguments = "imgpadding.py " + imgpath + " " + ekskey.text + " " + plaintext.text.replace(' ', '_');// start the python program with two parameters p.start(); // start the process (the python program) StreamReader s = p.standardoutput; String output = s.readtoend(); string[] r = output.split(new char[] ' ' ); // get the parameter string q = r[0]; string[] words = q.split('.'); paddedimgpath = words[0]; FileStream fs = new FileStream(words[0] + ".png", FileMode.Open); Image image = Image.FromStream(fs); picturebox2.sizemode = PictureBoxSizeMode.StretchImage; picturebox2.image = image; fs.close(); akhir = DateTime.Now; total = akhir - awal; waktupenyisipan = Convert.ToInt32(total.TotalMilliseconds); MessageBox.Show("Pesan Berhasil disisipkan!", "Informasi!", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show("Waktu penyisipan adalah: " + waktupenyisipan + " ms."); p.close(); private void button10_click(object sender, EventArgs e) OpenFileDialog thedialog = new OpenFileDialog(); thedialog.title = "Open Image File"; thedialog.filter = "PNG(*.png) *.png"; thedialog.initialdirectory thedialog.showdialog(); if (thedialog.filename.tostring()!= "") Image image = Image.FromFile(theDialog.FileName.ToString()); picturebox4.sizemode = PictureBoxSizeMode.StretchImage; picturebox4.image = image; imgpath = thedialog.filename.tostring(); MessageBox.Show("Citra berhasil diimport!", "Informasi!", MessageBoxButtons.OK, MessageBoxIcon.Information); private void button9_click(object sender, EventArgs e) DateTime awal; DateTime akhir; TimeSpan total; int waktupenyisipan; awal = DateTime.Now; Process p = new Process(); // create process (i.e., the python program p.startinfo.filename = "C:\\Python27\\python.exe"; p.startinfo.redirectstandardoutput = true; p.startinfo.useshellexecute = false; // make sure we can read the output from stdout

6 A-6 p.startinfo.arguments = "imgextractmsg.py " + imgpath;// start the python program with two parameters p.start(); // start the process (the python program) StreamReader s = p.standardoutput; String output = s.readtoend(); string[] r = output.split(new char[] ' ' ); // get the parameter string q = r[0]; string[] words = q.split('.'); chipdek.text = words[0]; akhir = DateTime.Now; total = akhir - awal; waktupenyisipan = Convert.ToInt32(total.TotalMilliseconds); MessageBox.Show("Pesan berhasil diekstrak!", "Informasi!", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show("Waktu ekstrsi adalah: " + waktupenyisipan + " ms."); p.close(); private void button1_click_1(object sender, EventArgs e) ekskey.text = ""; plaintext.text = ""; intkey.text = ""; ciphertext.text = ""; picturebox1.image = null; picturebox2.image = null; private void label7_click(object sender, EventArgs e) private void button2_click_1(object sender, EventArgs e) eksdek.text = ""; chipdek.text = ""; plaindek.text = ""; intdek.text = ""; picturebox4.image = null; 2. Function.py import binascii import Image def ascii_to_bit(message): return bin(int(binascii.hexlify(message), 16)).replace("b", "").rjust(8,'0') def bit_to_ascii(bit): ascii = ''; for i in range(0, len(bit), 8): n = int(bit[i:i+8], 2) ascii += binascii.unhexlify('%x' %n) return ascii

7 A-7 def divide_side(message_bit): i = 0 left = "" right = "" half_size = len(message_bit)/2; while (i < half_size): left = left + message_bit[i]; right = right + message_bit[i+half_size]; i+=1 return left,right def get_key_plus_bit(key_bit): pc_1 = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22,14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4] key_plus_bit = [] for i in range(0, len(pc_1)): key_plus_bit.append(key_bit[pc_1[i]-1]) return key_plus_bit def shift_bit(pre_bit, num_of_shift): for i in range(num_of_shift): temp_bit = pre_bit[0] pre_bit = pre_bit[1:] pre_bit += temp_bit return pre_bit def right_shift_bit(pre_bit, num_of_shift): for i in range(num_of_shift): temp_bit = pre_bit[27] pre_bit = pre_bit[:27] pre_bit = temp_bit + pre_bit return pre_bit def get_c1_to_c16(c, d): shift = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1] for i in range(16): c.append(shift_bit(c[i], shift[i])) d.append(shift_bit(d[i], shift[i])) return c, d def join(c, d): key_plus_block = [] for i in range(17): key_plus_block.append(c[i]+d[i]) return key_plus_block def get_key_plus_bit_2(cd_block): pc_2 = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32] key_plus_bit_2 = [] for i in range(1, len(cd_block)): cd_temp = "" for j in range (0, len(pc_2)): cd_temp += cd_block[i][pc_2[j]-1]; key_plus_bit_2.append(cd_temp) return key_plus_bit_2 def message_permutation_1(message):

8 A-8 ip = [58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7]; message_permutation_1 = "" for i in range(0, len(ip)): message_permutation_1 += message[ip[i]-1]; return message_permutation_1 def e_bit(message): e = [32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1]; e_bit = "" for i in range(0,len(e)): e_bit += message[e[i]-1]; return e_bit def xor_bit(e_rn,kn, x): result_bit = "" for i in range (0,len(e_rn)): result_bit += xor(e_rn[i], kn[x][i]) return result_bit def xor(bit1, bit2): if(bit1 == '1'): if(bit2=='1'): return'0' else: return'1' else: if(bit2=='1'): return '1' else: return'0' def b_n(k_xor): b_n = []; for i in range (0, len(k_xor), 6): temp = "" for j in range(i, i + 6): temp += k_xor[j] b_n.append(temp) return b_n def s_n(b_n, i, s): row = int(b_n[i][0]+b_n[i][5], 2) column = int(b_n[i][1]+b_n[i][2]+b_n[i][3]+b_n[i][4], 2) return bin(s[row][column]).replace("0b", "").zfill(4); def f(s_box): p = [16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25]; temp = "" for i in range(0, len(p)): temp+=(s_box[p[i]-1]) return temp def rn(ln_min1, f): temp = "" for i in range(0, len(f)):

9 A-9 temp += xor(ln_min1[i], f[i]) return temp def lnrn(kn, x, l, r): e = e_bit(r) m = xor_bit(e, kn, x) b = b_n(m) s1 = [[14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7],[0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8],[4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0],[ 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13]]; s2 = [[15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10],[ 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5],[0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15],[13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9]]; s3 = [[10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8],[13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1],[13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7], [1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12]]; s4 = [[7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15], [13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9], [10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4], [3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14]]; s5 = [[2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9], [14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 16], [4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14], [11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3]]; s6 = [[12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11], [10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8], [9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6], [4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13]]; s7 = [[4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1], [13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6], [1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2], [6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12]]; s8 =[[13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7], [1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2], [7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8], [2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11]]; s1b1 = s_n(b, 0, s1) s2b2 = s_n(b, 1, s2) s3b3 = s_n(b, 2, s3) s4b4 = s_n(b, 3, s4) s5b5 = s_n(b, 4, s5) s6b6 = s_n(b, 5, s6) s7b7 = s_n(b, 6, s7) s8b8 = s_n(b, 7, s8) s_box = s1b1 + s2b2 + s3b3 + s4b4 + s5b5 + s6b6 + s7b7 + s8b8 f_var = f(s_box) result = rn(l, f_var) return result def ip_min(rnln):

10 A-10 ip_inv = [40, 8, 48, 16, 56, 24, 64, 32, 39, 7, 47, 15, 55, 23, 63, 31, 38, 6, 46, 14, 54, 22, 62, 30, 37, 5, 45, 13, 53, 21, 61, 29, 36, 4, 44, 12, 52, 20, 60, 28, 35, 3, 43, 11, 51, 19, 59, 27, 34, 2, 42, 10, 50, 18, 58, 26, 33, 1, 41, 9, 49, 17, 57, 25]; temp = []; for i in range(0, len(ip_inv)): temp.append(rnln[ip_inv[i]-1]); encrypt_m_bit = ''.join(temp) return encrypt_m_bit def get_img_res(imgpath, param): if(param == 'height'): param = 0 else: param = 1 img = Image.open(imgPath) imgsize = img.size return imgsize[param] def get_img_px(imgpath): img = Image.open(imgPath) imgpx = img.load() x = get_img_res(imgpath, 'height'); # x -> height y = get_img_res(imgpath, 'width'); # y -> width plainpx = [] for i in range (x): for j in range (y): plainpx.append(imgpx[i, j]) return plainpx # Get blue pixels from image for padding process def get_bluepx0(rgbapx): bluepx = [] for i in range (0, len(rgbapx)): bluepx.append(rgbapx[i][2]) return bluepx # Get blue pixels from image to get padded message def get_bluepx1(rgbapx): bluepx = [] for i in range (0, len(rgbapx)): if(rgbapx[i][3] == 0): # If alpha 0, that's the message limit break bluepx.append(rgbapx[i][2]) return bluepx def pad_bluepx(bluepx, msgbit): bluebit = [] for i in range(0, len(msgbit)): bluepxlist = list(bin(bluepx[i]).replace("0b", "")) bluepxlist[len(bluepxlist)-1] = msgbit[i] joinedbluepx = ''.join(bluepxlist) newbluepx = int(joinedbluepx, 2) bluebit.append(newbluepx) return bluebit def set_bluepx_in_plainpx(blue_pixel, plain_pixel): temp = [] for i in range(0, len(blue_pixel)): temp = list(plain_pixel[i]) temp[2] = blue_pixel[i]

11 A-11 plain_pixel[i] = temp return plain_pixel def extract_bluepx(bluepx): msgbit = '' for i in range(0, len(bluepx)): bluepxlist = list(bin(bluepx[i]).replace("0b", "")) msgbit += bluepxlist[len(bluepxlist)-1] return msgbit def create_png(imgpath, rgbapx, imgname, msglength): x = get_img_res(imgpath, 'height')# x -> height y = get_img_res(imgpath, 'width')# y -> width img = Image.new('RGBA', (x, y), 'white') k = 0 for i in range(x): for j in range(y): R = rgbapx[k][0] G = rgbapx[k][1] B = rgbapx[k][2] if( k == msglength ): A = 0 else: A = 255 img.putpixel((i, j), (R, G, B, A)) k += 1 return img.save(imgname, 'PNG') def get_key_bin(key): key_bin = ascii_to_bit(key) key_bin_pc1 = get_key_plus_bit(key_bin) key_bin_div = divide_side(key_bin_pc1) c0 = key_bin_div[0] d0 = key_bin_div[1] c = [c0] d = [d0] key_bin_c1_c16 = get_c1_to_c16(c, d) c0 = key_bin_c1_c16[0] d0 = key_bin_c1_c16[1] key_bin_join = join(c0,d0) key_bin_pc2 = get_key_plus_bit_2(key_bin_join) return key_bin_pc2 def encrypt_m(key_bin_pc2, message): message_bin = '' for i in range(0, 8): temp_bin = ascii_to_bit(message[i]) message_bin += temp_bin ip1 = message_permutation_1(message_bin) message_divide = divide_side(ip1) l0 = message_divide[0] r0 = message_divide[1] ln = l0 rn = r0 x = 0 while(x < 16): r_temp = rn

12 A-12 rn = lnrn(key_bin_pc2, x, ln, rn) ln = r_temp x += 1 rnln = str(rn) + str(ln) joined_c = "" c = ip_min(rnln) joined_c += c return joined_c def get_cipher_message(key_bin_pc2, message): padded_m = '' for i in range(0, len(message), 8): char_length = len(message[i:i+8]) if ( char_length < 8 ): padded_m += message[i:i+char_length].ljust(8,' ') else: padded_m += message[i:i+8].ljust(8,' ') message = padded_m join_e_m = '' for i in range(0, len(message), 8): join_e_m += encrypt_m(key_bin_pc2,message[i:i+8]) return join_e_m def decrypt_m(key_bin_pc2, message_bin): ip1 = message_permutation_1(message_bin) message_divide = divide_side(ip1) l0 = message_divide[0] r0 = message_divide[1] ln = l0 rn = r0 x = 15 while(x >- 1): r_temp = rn rn = lnrn(key_bin_pc2, x, ln, rn) ln = r_temp x -= 1 rnln = str(rn) + str(ln) joined_c = "" c = ip_min(rnln) joined_c += c return joined_c def get_plain_message(key_bin_pc2, message): join_e_m = '' for i in range(0, len(message), 64): join_e_m += decrypt_m(key_bin_pc2, message[i:i+64]) return join_e_m

13 A Internal_key.py from function import * import sys #mengambil nilai dari argument ekskey.text key = sys.argv[1] key_bin_pc2 = get_key_bin(key) print str(key_bin_pc2) 4. Enkripsi_pesan.py from function import * import binascii import sys message = sys.argv[1].replace('_', ' '); key = sys.argv[2] key_bin_pc2 = get_key_bin(key) print get_cipher_message(key_bin_pc2, message) 5. ImgPadding.py from function import * import sys imgpath = sys.argv[1] key = sys.argv[2] message = sys.argv[3].replace('_', ' '); key_bin_pc2 = get_key_bin(key) joined_c = get_cipher_message(key_bin_pc2, message) msgbit = joined_c msglength = len(msgbit) plainpx = get_img_px(imgpath) bluepx = get_bluepx0(plainpx) paddedbluepx = pad_bluepx(bluepx, msgbit) paddedplainpx = set_bluepx_in_plainpx(paddedbluepx, plainpx) imgname = "D:\\PaddedImage.png" create_png(imgpath, paddedplainpx, imgname, msglength) print imgname

14 A Dekripsi_pesan.py from function import * import binascii import sys key = sys.argv[2] imgpath = sys.argv[1] key_bin_pc2 = get_key_bin(key) plainpx = get_img_px(imgpath) bluepx = get_bluepx1(plainpx) message = extract_bluepx(bluepx) plain_bit = get_plain_message(key_bin_pc2, message) print bit_to_ascii(plain_bit) 7. ImgExtractMsg.py from function import * import sys imgpath = sys.argv[1] plainpx = get_img_px(imgpath) bluepx = get_bluepx1(plainpx) msgbit = extract_bluepx(bluepx) print str(msgbit)

15 B - 1 CURRICULUM VITAE Data Pribadi Nama : Hengky Prayson Fangaro Gulo Tempat/Tanggal Lahir : Gunung Sitoli / 28 Agustus 1992 Tinggi/Berat Badan : 169 cm / 100 kg Agama : Kristen Protestan Kewarganegaraan : Indonesia Alamat : Jl. Jahe 6 no.2 Perumnas Simalingkar Medan Alamat Orang Tua : Jl. Jahe 6 no.2 Perumnas Simalingkar Medan Telp/ Hp : hengkygulo@gmail.com Riwayat Pendidikan [ ] : S1 Ilmu Komputer, Medan [ ] : SMK Negeri 9 Medan [ ] : SMP Negeri 10 Medan [ ] : SD Negeri Tohia Gunung Sitoli

16 B Keahlian/Kursus Keahlian Komputer Bahasa : Pemrograman :Pyhton, C#, C++ English Database : MySQL Indonesia Perkantoran : Microsoft Office

LISTING PROGRAM. 1. Module SkripsiUmri.py. import sys, operator, codecs, time. class Timer(object): def init (self): self.t1= time.

LISTING PROGRAM. 1. Module SkripsiUmri.py. import sys, operator, codecs, time. class Timer(object): def init (self): self.t1= time. A1 LISTING PROGRAM 1. Module SkripsiUmri.py import sys, operator, codecs, time class Timer(object): def init (self): self.t1= time.time() def getelapsedltime(self): # gets total elapsed from class initialsation

More information

LISTING PROGRAM. a = b; b = c; c = a + b; } fibs.reverse(); for (int i = 0; i < fibs.count; i++) { if (n >= fibs[i]) { n = n - fibs[i];

LISTING PROGRAM. a = b; b = c; c = a + b; } fibs.reverse(); for (int i = 0; i < fibs.count; i++) { if (n >= fibs[i]) { n = n - fibs[i]; A-1 A LISTING PROGRAM 1. Fibonacci Code //membuat fungsi Fibonacci Code public static String GetFibonacciCode(int n) { StringBuilder fib = new StringBuilder("1"); int a, b, c; List fibs = new List();

More information

LAMPIRAN A : LISTING PROGRAM

LAMPIRAN A : LISTING PROGRAM LAMPIRAN A : LISTING PROGRAM 1. Form Utama (Cover) using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;

More information

LAMPIRAN A : LISTING PROGRAM

LAMPIRAN A : LISTING PROGRAM 46 LAMPIRAN A : LISTING PROGRAM 1. Mainform /* * Created by SharpDevelop. * User: User7 * Date: 28/09/2015 * Time: 9:38 * * To change this template use Tools Options Coding Edit Standard Headers. */ using

More information

LAMPIRAN A LISTING PROGRAM

LAMPIRAN A LISTING PROGRAM A-1 LAMPIRAN A LISTING PROGRAM FUNGSI public void StopWatchStart() stopwatch.reset(); stopwatch.start(); Cursor.Current = Cursors.WaitCursor; txtlog.text = ""; public void StopWatchStop(string Title) stopwatch.stop();

More information

LISTING PROGRAM. private void filetoolstripmenuitem_click(object sender, EventArgs e) { this.hide(); Form2 fr = new Form2(); fr.

LISTING PROGRAM. private void filetoolstripmenuitem_click(object sender, EventArgs e) { this.hide(); Form2 fr = new Form2(); fr. Kode Program Form Home namespace SkripsiLagi public partial class Form9 : Form public Form9() LISTING PROGRAM private void filetoolstripmenuitem_click(object sender, EventArgs e) Form2 fr = new Form2();

More information

create database ABCD use ABCD create table bolumler ( bolumkodu int primary key, bolumadi varchar(20) )

create database ABCD use ABCD create table bolumler ( bolumkodu int primary key, bolumadi varchar(20) ) create database ABCD use ABCD create table bolumler ( bolumkodu int primary key, bolumadi varchar(20) ) insert into bolumler values(1,'elektrik') insert into bolumler values(2,'makina') insert into bolumler

More information

CALCULATOR APPLICATION

CALCULATOR APPLICATION CALCULATOR APPLICATION Form1.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;

More information

LISTING PROGRAM. void KOMPRESIToolStripMenuItemClick(object sender, EventArgs e) { Kompresi k = new Kompresi(); k.show(); this.

LISTING PROGRAM. void KOMPRESIToolStripMenuItemClick(object sender, EventArgs e) { Kompresi k = new Kompresi(); k.show(); this. A - 1 LISTING PROGRAM 1. Form Menu Utama using System; using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; namespace KompresiCitra / / Description of MainForm.

More information

To start we will be using visual studio Start a new C# windows form application project and name it motivational quotes viewer

To start we will be using visual studio Start a new C# windows form application project and name it motivational quotes viewer C# Tutorial Create a Motivational Quotes Viewer Application in Visual Studio In this tutorial we will create a fun little application for Microsoft Windows using Visual Studio. You can use any version

More information

For this example, we will set up a small program to display a picture menu for a fast food take-away shop.

For this example, we will set up a small program to display a picture menu for a fast food take-away shop. 146 Programming with C#.NET 9 Fast Food This program introduces the technique for uploading picture images to a C# program and storing them in a database table, in a similar way to text or numeric data.

More information

LISTING PROGRAM. mainform.vb A-1. Universitas Sumatera Utara

LISTING PROGRAM. mainform.vb A-1. Universitas Sumatera Utara A-1 LISTING PROGRAM mainform.vb Imports System.IO Public Class mainform Private Sub mainform_load(byval sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load enkripsirb.checked = True

More information

LISTING PROGRAM. namespace vigenere_des { public partial class MainPage : PhoneApplicationPage { public MainPage() { InitializeComponent(); }

LISTING PROGRAM. namespace vigenere_des { public partial class MainPage : PhoneApplicationPage { public MainPage() { InitializeComponent(); } 59 LISTING PROGRAM Form Utama : using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Navigation;

More information

// Precondition: None // Postcondition: The address' name has been set to the // specified value set;

// Precondition: None // Postcondition: The address' name has been set to the // specified value set; // File: Address.cs // This classes stores a typical US address consisting of name, // two address lines, city, state, and 5 digit zip code. using System; using System.Collections.Generic; using System.Linq;

More information

CSIS 1624 CLASS TEST 6

CSIS 1624 CLASS TEST 6 CSIS 1624 CLASS TEST 6 Instructions: Use visual studio 2012/2013 Make sure your work is saved correctly Submit your work as instructed by the demmies. This is an open-book test. You may consult the printed

More information

Listing Program. private void exittoolstripmenuitem_click(object sender, EventArgs e) { Application.Exit(); }

Listing Program. private void exittoolstripmenuitem_click(object sender, EventArgs e) { Application.Exit(); } Listing Program Kode Program Menu Home: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using

More information

LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent() call. //

LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent() call. // 1. MainForm.cs using System.Collections.Generic; using System.Drawing; LISTING PROGRAM / / Description of MainForm. / public partial class MainForm : Form public MainForm() The InitializeComponent()

More information

Lecture 8 Building an MDI Application

Lecture 8 Building an MDI Application Lecture 8 Building an MDI Application Introduction The MDI (Multiple Document Interface) provides a way to display multiple (child) windows forms inside a single main(parent) windows form. In this example

More information

Object oriented lab /second year / review/lecturer: yasmin maki

Object oriented lab /second year / review/lecturer: yasmin maki 1) Examples of method (function): Note: the declaration of any method is : method name ( parameters list ).. Method body.. Access modifier : public,protected, private. Return

More information

Main Game Code. //ok honestly im not sure, if i guess its a class ment for this page called methodtimer that //either uses the timer or set to timer..

Main Game Code. //ok honestly im not sure, if i guess its a class ment for this page called methodtimer that //either uses the timer or set to timer.. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;

More information

Answer on Question# Programming, C#

Answer on Question# Programming, C# Answer on Question#38723 - Programming, C# 1. The development team of SoftSols Inc. has revamped the software according to the requirements of FlyHigh Airlines and is in the process of testing the software.

More information

You can call the project anything you like I will be calling this one project slide show.

You can call the project anything you like I will be calling this one project slide show. C# Tutorial Load all images from a folder Slide Show In this tutorial we will see how to create a C# slide show where you load everything from a single folder and view them through a timer. This exercise

More information

Huw Talliss Data Structures and Variables. Variables

Huw Talliss Data Structures and Variables. Variables Data Structures and Variables Variables The Regex class represents a read-only regular expression. It also contains static methods that allow use of other regular expression classes without explicitly

More information

LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent()

LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent() A- 1 LISTING PROGRAM Form1.cs (Pengirim) /* * Created by SharpDevelop. * User: Lia * Date: 3/13/2017 * Time: 9:43 PM * * To change this template use Tools Options Coding Edit Standard Headers. */ using

More information

IBSDK Quick Start Tutorial for C# 2010

IBSDK Quick Start Tutorial for C# 2010 IB-SDK-00003 Ver. 3.0.0 2012-04-04 IBSDK Quick Start Tutorial for C# 2010 Copyright @2012, lntegrated Biometrics LLC. All Rights Reserved 1 QuickStart Project C# 2010 Example Follow these steps to setup

More information

Create your own Meme Maker in C#

Create your own Meme Maker in C# Create your own Meme Maker in C# This tutorial will show how to create a meme maker in visual studio 2010 using C#. Now we are using Visual Studio 2010 version you can use any and still get the same result.

More information

} } public void getir() { DataTable dt = vt.dtgetir("select* from stok order by stokadi");

} } public void getir() { DataTable dt = vt.dtgetir(select* from stok order by stokadi); Form1 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;

More information

Form Properties Window

Form Properties Window C# Tutorial Create a Save The Eggs Item Drop Game in Visual Studio Start Visual Studio, Start a new project. Under the C# language, choose Windows Form Application. Name the project savetheeggs and click

More information

Appendix A Programkod

Appendix A Programkod Appendix A Programkod ProgramForm.cs using System; using System.Text; using System.Windows.Forms; using System.Net; using System.IO; using System.Text.RegularExpressions; using System.Collections.Generic;

More information

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at:

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at: This document describes how to create a simple Windows Forms Application using some Open Core Interface functions in C# with Microsoft Visual Studio Express 2013. 1 Preconditions The Open Core Interface

More information

Using Template Bookmarks for Automating Microsoft Word Reports

Using Template Bookmarks for Automating Microsoft Word Reports Using Template Bookmarks for Automating Microsoft Word Reports Darryl Bryk U.S. Army RDECOM-TARDEC Warren, MI 48397 Disclaimer: Reference herein to any specific commercial company, product, process, or

More information

if (say==0) { k.commandtext = "Insert into kullanici(k_adi,sifre) values('" + textbox3.text + "','" + textbox4.text + "')"; k.

if (say==0) { k.commandtext = Insert into kullanici(k_adi,sifre) values(' + textbox3.text + ',' + textbox4.text + '); k. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient;

More information

LISTING PROGRAM. void FilteringToolStripMenuItemClick(object sender, EventAr s e) { Filtering a = new Filtering(); this.hide(); a.

LISTING PROGRAM. void FilteringToolStripMenuItemClick(object sender, EventAr s e) { Filtering a = new Filtering(); this.hide(); a. 130 LISTING PROGRAM 1. Mainform.cs using System; using System.Drawing; using System.Windows.Forms; namespace AnalisisPerbandinganFilertingdanDeteksiTepi public partial class MainForm : Form public MainForm()

More information

Start Visual Studio and create a new windows form application under C# programming language. Call this project YouTube Alarm Clock.

Start Visual Studio and create a new windows form application under C# programming language. Call this project YouTube Alarm Clock. C# Tutorial - Create a YouTube Alarm Clock in Visual Studio In this tutorial we will create a simple yet elegant YouTube alarm clock in Visual Studio using C# programming language. The main idea for this

More information

Sub To Srt Converter. This is the source code of this program. It is made in C# with.net 2.0.

Sub To Srt Converter. This is the source code of this program. It is made in C# with.net 2.0. Sub To Srt Converter This is the source code of this program. It is made in C# with.net 2.0. form1.css /* * Name: Sub to srt converter * Programmer: Paunoiu Alexandru Dumitru * Date: 5.11.2007 * Description:

More information

Team project 2017 Dony Pratidana S. Hum Bima Agus Setyawan S. IIP

Team project 2017 Dony Pratidana S. Hum Bima Agus Setyawan S. IIP Hak cipta dan penggunaan kembali: Lisensi ini mengizinkan setiap orang untuk menggubah, memperbaiki, dan membuat ciptaan turunan bukan untuk kepentingan komersial, selama anda mencantumkan nama penulis

More information

Now find the button component in the tool box. [if toolbox isn't present click VIEW on the top and click toolbox]

Now find the button component in the tool box. [if toolbox isn't present click VIEW on the top and click toolbox] C# Tutorial - Create a Tic Tac Toe game with Working AI This project will be created in Visual Studio 2010 however you can use any version of Visual Studio to follow along this tutorial. To start open

More information

Visual Basic/C# Programming (330)

Visual Basic/C# Programming (330) Page 1 of 12 Visual Basic/C# Programming (330) REGIONAL 2017 Production Portion: Program 1: Calendar Analysis (400 points) TOTAL POINTS (400 points) Judge/Graders: Please double check and verify all scores

More information

A-1 LAMPIRAN A LISTING PROGRAM. Kode Program Form Main: Universitas Sumatera Utara

A-1 LAMPIRAN A LISTING PROGRAM. Kode Program Form Main: Universitas Sumatera Utara A-1 LAMPIRAN A A LISTING PROGRAM Kode Program Form Main: #Region Project Attributes #ApplicationLabel: Samuel Panjaitan #VersionCode: 1 #VersionName: #SupportedOrientations: portrait #CanInstallToExternalStorage:

More information

Chapter 8 Advanced GUI Features

Chapter 8 Advanced GUI Features 159 Chapter 8 Advanced GUI Features There are many other features we can easily add to a Windows C# application. We must be able to have menus and dialogs along with many other controls. One workhorse

More information

Eyes of the Dragon - XNA Part 37 Map Editor Revisited

Eyes of the Dragon - XNA Part 37 Map Editor Revisited Eyes of the Dragon - XNA Part 37 Map Editor Revisited I'm writing these tutorials for the XNA 4.0 framework. Even though Microsoft has ended support for XNA it still runs on all supported operating systems

More information

LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent()

LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent() A-1 LISTING PROGRAM Form Mainform /* * Created by SharpDevelop. * User: Roni Anggara * Date: 5/17/2016 * Time: 8:52 PM * * To change this template use Tools Options Coding Edit Standard Headers. */ using

More information

C# winforms gridview

C# winforms gridview C# winforms gridview using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;

More information

UNIT-3. Prepared by R.VINODINI 1

UNIT-3. Prepared by R.VINODINI 1 Prepared by R.VINODINI 1 Prepared by R.VINODINI 2 Prepared by R.VINODINI 3 Prepared by R.VINODINI 4 Prepared by R.VINODINI 5 o o o o Prepared by R.VINODINI 6 Prepared by R.VINODINI 7 Prepared by R.VINODINI

More information

Start Visual Studio, create a new project called Helicopter Game and press OK

Start Visual Studio, create a new project called Helicopter Game and press OK C# Tutorial Create a helicopter flying and shooting game in visual studio In this tutorial we will create a fun little helicopter game in visual studio. You will be flying the helicopter which can shoot

More information

This is the empty form we will be working with in this game. Look under the properties window and find the following and change them.

This is the empty form we will be working with in this game. Look under the properties window and find the following and change them. We are working on Visual Studio 2010 but this project can be remade in any other version of visual studio. Start a new project in Visual Studio, make this a C# Windows Form Application and name it zombieshooter.

More information

// Program 2 - Extra Credit // CIS // Spring // Due: 3/11/2015. // By: Andrew L. Wright. //Edited by : Ben Spalding

// Program 2 - Extra Credit // CIS // Spring // Due: 3/11/2015. // By: Andrew L. Wright. //Edited by : Ben Spalding // Program 2 - Extra Credit // CIS 200-01 // Spring 2015 // Due: 3/11/2015 // By: Andrew L. Wright //Edited by : Ben Spalding // File: Prog2Form.cs // This class creates the main GUI for Program 2. It

More information

LISTING PROGRAM. % UIWAIT makes pertama wait for user response (see UIRESUME) % uiwait(handles.figure1);

LISTING PROGRAM. % UIWAIT makes pertama wait for user response (see UIRESUME) % uiwait(handles.figure1); LISTING PROGRAM FORM PERTAMA : function varargout = pertama(varargin) gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @pertama_openingfcn,...

More information

Writing Your First Autodesk Revit Model Review Plug-In

Writing Your First Autodesk Revit Model Review Plug-In Writing Your First Autodesk Revit Model Review Plug-In R. Robert Bell Sparling CP5880 The Revit Model Review plug-in is a great tool for checking a Revit model for matching the standards your company has

More information

APÉNDICE J. CÓDIGO DEL ARCHIVO FORM1.CS EN LENGUAJE C# Comprende:

APÉNDICE J. CÓDIGO DEL ARCHIVO FORM1.CS EN LENGUAJE C# Comprende: APÉNDICE J. CÓDIGO DEL ARCHIVO FORM1.CS EN LENGUAJE C# Comprende: Interfaz gráfica de wiimocap. Obtención de las variables de los tres acelerómetros. Algoritmos de reconocimiento de posiciones. Inclinación

More information

string spath; string sedifile = "277_005010X228.X12"; string sseffile = "277_005010X228.SemRef.EVAL0.SEF";

string spath; string sedifile = 277_005010X228.X12; string sseffile = 277_005010X228.SemRef.EVAL0.SEF; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Edidev.FrameworkEDI; 1 namespace

More information

// Specify SEF file to load. oschema = (edischema) oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format);

// Specify SEF file to load. oschema = (edischema) oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format); using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Edidev.FrameworkEDI;

More information

Mainly three tables namely Teacher, Student and Class for small database of a school. are used. The snapshots of all three tables are shown below.

Mainly three tables namely Teacher, Student and Class for small database of a school. are used. The snapshots of all three tables are shown below. APPENDIX 1 TABLE DETAILS Mainly three tables namely Teacher, Student and Class for small database of a school are used. The snapshots of all three tables are shown below. Details of Class table are shown

More information

Click on the empty form and apply the following options to the properties Windows.

Click on the empty form and apply the following options to the properties Windows. Start New Project In Visual Studio Choose C# Windows Form Application Name it SpaceInvaders and Click OK. Click on the empty form and apply the following options to the properties Windows. This is the

More information

FDSc in ICT. Building a Program in C#

FDSc in ICT. Building a Program in C# FDSc in ICT Building a Program in C# Objectives To build a complete application in C# from scratch Make a banking app Make use of: Methods/Functions Classes Inheritance Scenario We have a bank that has

More information

Brian Kiser November Vigilant C# 2.5. Commonwealth of Kentucky Frankfort, Kentucky

Brian Kiser November Vigilant C# 2.5. Commonwealth of Kentucky Frankfort, Kentucky Brian Kiser November 2010 Vigilant C# 2.5 Commonwealth of Kentucky Frankfort, Kentucky Table of Contents 1.0 Work Sample Description Page 3 2.0 Skills Demonstrated 2.1 Software development competency using

More information

XNA 4.0 RPG Tutorials. Part 24. Level Editor Continued

XNA 4.0 RPG Tutorials. Part 24. Level Editor Continued XNA 4.0 RPG Tutorials Part 24 Level Editor Continued I'm writing these tutorials for the new XNA 4.0 framework. The tutorials will make more sense if they are read in order. You can find the list of tutorials

More information

// Specify SEF file to load. edischema oschema = oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format);

// Specify SEF file to load. edischema oschema = oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format); using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Edidev.FrameworkEDIx64;

More information

عنوان مقاله : خواندن و نوشتن محتوای فایل های Excel بدون استفاده ازAutomation Excel تهیه وتنظیم کننده : مرجع تخصصی برنامه نویسان

عنوان مقاله : خواندن و نوشتن محتوای فایل های Excel بدون استفاده ازAutomation Excel تهیه وتنظیم کننده : مرجع تخصصی برنامه نویسان در این مقاله با دو روش از روشهای خواندن اطالعات از فایل های اکسل و نوشتن آنها در DataGridView بدون استفاده از ( Automation Excelبا استفاده از NPOI و( ADO.Net آشنا میشوید. راه اول : با استفاده از (xls)

More information

How to create a simple ASP.NET page to create/search data on baan using baan logic from the BOBS client sample.

How to create a simple ASP.NET page to create/search data on baan using baan logic from the BOBS client sample. How to create a simple ASP.NET page to create/search data on baan using baan logic from the BOBS client sample. Author: Carlos Kassab Date: July/24/2006 First install BOBS(BaaN Ole Broker Server), you

More information

IST311 Chapter13.NET Files (Part2)

IST311 Chapter13.NET Files (Part2) IST311 Chapter13.NET Files (Part2) using System; using System.Collections.Generic; using System.ComponentModel; using System.IO; using System.Linq; using System.Net; using System.Net.Sockets; using System.Text;

More information

RegEx - Numbers matching. Below is a sample code to find the existence of integers within a string.

RegEx - Numbers matching. Below is a sample code to find the existence of integers within a string. RegEx - Numbers matching Below is a sample code to find the existence of integers within a string. Sample code pattern to check for number in a string: using System; using System.Collections.Generic; using

More information

Listing Progam. Universitas Sumatera Utara

Listing Progam. Universitas Sumatera Utara 60 Listing Progam Listing Program Tabel Index

More information

RegEx-validate IP address. Defined below is the pattern for checking an IP address with value: String Pattern Explanation

RegEx-validate IP address. Defined below is the pattern for checking an IP address with value: String Pattern Explanation RegEx-validate IP address Defined below is the pattern for checking an IP address with value: 240.30.20.60 String Pattern Explanation 240 ^[0-9]1,3 To define the starting part as number ranging from 1

More information

Class Test 5. Create a simple paint program that conforms to the following requirements.

Class Test 5. Create a simple paint program that conforms to the following requirements. Class Test 5 Question 1 Use visual studio 2012 ultimate to create a C# windows forms application. Create a simple paint program that conforms to the following requirements. The control box is disabled

More information

private void Form1_Load(object sender, EventArgs e) {

private void Form1_Load(object sender, EventArgs e) { viii LAMPIRAN LISTING PROGRAM 1. Form Home using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using

More information

pojedinačnom elementu niza se pristupa imeniza[indeks] indeks od 0 do n-1

pojedinačnom elementu niza se pristupa imeniza[indeks] indeks od 0 do n-1 NIZOVI Niz deklarišemo navođenjemtipa elemenata za kojim sledi par srednjih zagrada[] i naziv niza. Ako je niz višedimenzionalni između zagrada[] se navode zarezi, čiji je broj za jedan manji od dimenzija

More information

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output General Date Your Company Name Tel: +44 1234 567 9898 Fax: +44 1234 545 9999 email: info@@company.com Microsoft Visual Studio C# Project Source Code Output Created using VScodePrint Macro Variables Substitution

More information

Chapter 6 Dialogs. Creating a Dialog Style Form

Chapter 6 Dialogs. Creating a Dialog Style Form Chapter 6 Dialogs We all know the importance of dialogs in Windows applications. Dialogs using the.net FCL are very easy to implement if you already know how to use basic controls on forms. A dialog is

More information

We are going to use some graphics and found a nice little batman running GIF, off course you can use any image you want for the project.

We are going to use some graphics and found a nice little batman running GIF, off course you can use any image you want for the project. C# Tutorial - Create a Batman Gravity Run Game Start a new project in visual studio and call it gravityrun It should be a windows form application with C# Click OK Change the size of the to 800,300 and

More information

Overview. Building a Web-Enabled Decision Support System. Integrating DSS in Business Curriculum. Introduction to DatabaseSupport Systems

Overview. Building a Web-Enabled Decision Support System. Integrating DSS in Business Curriculum. Introduction to DatabaseSupport Systems Excel and C# Overview Introduction to DatabaseSupport Systems Building a Web-Enabled Decision Support System Integrating DSS in Business Curriculum 2 Decision Support Systems (DSS) A decision support system

More information

Quick Guide for the ServoWorks.NET API 2010/7/13

Quick Guide for the ServoWorks.NET API 2010/7/13 Quick Guide for the ServoWorks.NET API 2010/7/13 This document will guide you through creating a simple sample application that jogs axis 1 in a single direction using Soft Servo Systems ServoWorks.NET

More information

II. Programming Technologies

II. Programming Technologies II. Programming Technologies II.1 The machine code program Code of algorithm steps + memory addresses: MOV AX,1234h ;0B8h 34h 12h - number (1234h) to AX register MUL WORD PTR [5678h] ;0F7h 26h 78h 56h

More information

Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK.

Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK. Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK. Before you start - download the game assets from above or on MOOICT.COM to

More information

visual studio vs#d express windows desktop

visual studio vs#d express windows desktop Free software used in development 1. Visual studio express 2013 for desktop applications. Express versions are free without time limit, only thing you need is Microsoft account (but you can download and

More information

C:\homeworks\PenAttention_v13_src\PenAttention_v13_src\PenAttention4\PenAttention\PenAttention.cs 1 using System; 2 using System.Diagnostics; 3 using

C:\homeworks\PenAttention_v13_src\PenAttention_v13_src\PenAttention4\PenAttention\PenAttention.cs 1 using System; 2 using System.Diagnostics; 3 using 1 using System; 2 using System.Diagnostics; 3 using System.Collections.Generic; 4 using System.ComponentModel; 5 using System.Data; 6 using System.Drawing; 7 using System.Text; 8 using System.Windows.Forms;

More information

namespace csharp_gen277x214 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

namespace csharp_gen277x214 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } using System using System.Collections.Generic using System.ComponentModel using System.Data using System.Drawing using System.Text using System.Windows.Forms using Edidev.FrameworkEDI 1 namespace csharp_gen277x214

More information

Computer measurement and control

Computer measurement and control Computer measurement and control Instructors: András Magyarkuti, Zoltán Kovács-Krausz BME TTK, Department of Physics 2017/2018 spring semester Copyright 2008-2018 András Magyarkuti, Attila Geresdi, András

More information

Experiment 5 : Creating a Windows application to interface with 7-Segment LED display

Experiment 5 : Creating a Windows application to interface with 7-Segment LED display Experiment 5 : Creating a Windows application to interface with 7-Segment LED display Objectives : 1) To understand the how Windows Forms in the Windows-based applications. 2) To create a Window Application

More information

In-Class Worksheet #4

In-Class Worksheet #4 CSE 459.24 Programming in C# Richard Kidwell In-Class Worksheet #4 Creating a Windows Forms application with Data Binding You should have Visual Studio 2008 open. 1. Create a new Project either from the

More information

2.3 Add GDS Google Map to Visual Studio Toolbox and create a simple map project

2.3 Add GDS Google Map to Visual Studio Toolbox and create a simple map project 1. Introduction GDS Google Map is a Desktop.Net User Control, which can be embedded in Windows Forms Applications or hosted in WPF Applications. It integrates an interactive Google Map into your desktop

More information

Risk Sharing Pool. File Transfer via Web Services Technical Guide

Risk Sharing Pool. File Transfer via Web Services Technical Guide Risk Sharing Pool File Transfer via Web Services Technical Guide August 30, 2017 Version 1.3 1. REVISION HISTORY Date Document Version April 8, 2008 Version 1.0 Section Modified Modification May 28, 2008

More information

private void closetoolstripmenuitem_click(object sender, EventArgs e) { this.close(); }

private void closetoolstripmenuitem_click(object sender, EventArgs e) { this.close(); } MEMBER PAYMENTS FORM public partial class MemberPaymentsForm : Form public MemberPaymentsForm() private void MemberPaymentsForm_Load(object sender, EventArgs e) // TODO: This line of code loads data into

More information

Bachelor s Thesis: Building Web Application for Mahabad University Graduate Affairs Afsaneh Nezami Savojbolaghi

Bachelor s Thesis: Building Web Application for Mahabad University Graduate Affairs Afsaneh Nezami Savojbolaghi Bachelor s Thesis: Building Web Application for Mahabad University Graduate Affairs Afsaneh Nezami Savojbolaghi Turku University of Applied Sciences Degree Programme in Business Information Technology

More information

Class Test 4. Question 1. Use notepad to create a console application that displays a stick figure. See figure 1. Question 2

Class Test 4. Question 1. Use notepad to create a console application that displays a stick figure. See figure 1. Question 2 Class Test 4 Marks will be deducted for each of the following: -5 for each class/program that does not contain your name and student number at the top. -2 If program is named anything other than Question1,

More information

Developing for Mobile Devices Lab (Part 1 of 2)

Developing for Mobile Devices Lab (Part 1 of 2) Developing for Mobile Devices Lab (Part 1 of 2) Overview Through these two lab sessions you will learn how to create mobile applications for Windows Mobile phones and PDAs. As developing for Windows Mobile

More information

LIGHT_P_TOGGLE, LIGHT_N_TOGGLE, BATTERY_TOGGLE, ALTERNATOR_TOGGLE, AVIONICS_TOGGLE, FLOAT_RETRACT, FLOAT_EXTEND }

LIGHT_P_TOGGLE, LIGHT_N_TOGGLE, BATTERY_TOGGLE, ALTERNATOR_TOGGLE, AVIONICS_TOGGLE, FLOAT_RETRACT, FLOAT_EXTEND } using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO.Ports; using Microsoft.FlightSimulator.SimConnect;

More information

LISTING PROGRAM. com.example.jessicatamara.myapplication4;

LISTING PROGRAM. com.example.jessicatamara.myapplication4; A-1 LISTING PROGRAM MainActivity.java package import import import import import import com.example.jessicatamara.myapplication4; android.content.intent; android.support.v7.app.appcompatactivity; android.os.bundle;

More information

بسم هللا الرحمن الرحيم المحاضرة السابعة مستوى ثالث علوم حاسوب برمجة مرئية 2 )عملي ) جامعة الجزيرة محافظة اب الجمهورية اليمنية النافذة الرئيسية

بسم هللا الرحمن الرحيم المحاضرة السابعة مستوى ثالث علوم حاسوب برمجة مرئية 2 )عملي ) جامعة الجزيرة محافظة اب الجمهورية اليمنية النافذة الرئيسية بسم هللا الرحمن الرحيم المحاضرة السابعة مستوى ثالث علوم حاسوب برمجة مرئية 2 )عملي ) جامعة الجزيرة محافظة اب الجمهورية اليمنية النافذة الرئيسية وتمتلك الشفرة البرمجية التالية : زر االقسام fr_dept fd = new

More information

LISTING PROGRAM. if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); else gui_mainfcn(gui_state, varargin{:}); end

LISTING PROGRAM. if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); else gui_mainfcn(gui_state, varargin{:}); end A-1 LISTING PROGRAM 1. Form Cover function varargout = cover(varargin) gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @cover_openingfcn,...

More information

Your First Windows Form

Your First Windows Form Your First Windows Form From now on, we re going to be creating Windows Forms Applications, rather than Console Applications. Windows Forms Applications make use of something called a Form. The Form is

More information

LISTING PROGRAM. % Edit the above text to modify the response to help cover. % Last Modified by GUIDE v Jun :24:43

LISTING PROGRAM. % Edit the above text to modify the response to help cover. % Last Modified by GUIDE v Jun :24:43 A1 LISTING PROGRAM 1. Form Cover function varargout = cover(varargin) COVER MATLAB code for cover.fig COVER, by itself, creates a new COVER or raises the existing singleton*. H = COVER returns the handle

More information

namespace spojneice { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

namespace spojneice { public partial class Form1 : Form { public Form1() { InitializeComponent(); } Spojnice using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO;

More information

private string sconnection = ConfigurationManager.ConnectionStrings["Development"].ConnectionString

private string sconnection = ConfigurationManager.ConnectionStrings[Development].ConnectionString using System; using System.Configuration; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Text; using System.Windows.Forms;

More information

Chapter 2. Ans. C (p. 55) 2. Which is not a control you can find in the Toolbox? A. Label B. PictureBox C. Properties Window D.

Chapter 2. Ans. C (p. 55) 2. Which is not a control you can find in the Toolbox? A. Label B. PictureBox C. Properties Window D. Chapter 2 Multiple Choice 1. According to the following figure, which statement is incorrect? A. The size of the selected object is 300 pixels wide by 300 pixels high. B. The name of the select object

More information

Conventions in this tutorial

Conventions in this tutorial This document provides an exercise using Digi JumpStart for Windows Embedded CE 6.0. This document shows how to develop, run, and debug a simple application on your target hardware platform. This tutorial

More information

Lampiran 2 MASTER TABEL

Lampiran 2 MASTER TABEL 64 Lampiran 2 MASTER TABEL No. No. Responden Umur Pendidikan Pekerjaan Paritas Kanker 1 427363 35 S1 PNS 4 Tidak 2 504024 36 SMA IRT 4 Tidak 3 500316 35 SMA IRT 5 Tidak 4 504014 35 SMA PNS 1 Tidak 5 447158

More information

Representing Recursive Relationships Using REP++ TreeView

Representing Recursive Relationships Using REP++ TreeView Representing Recursive Relationships Using REP++ TreeView Author(s): R&D Department Publication date: May 4, 2006 Revision date: May 2010 2010 Consyst SQL Inc. All rights reserved. Representing Recursive

More information

Visual Studio Windows Form Application #1 Basic Form Properties

Visual Studio Windows Form Application #1 Basic Form Properties Visual Studio Windows Form Application #1 Basic Form Properties Dr. Thomas E. Hicks Computer Science Department Trinity University Purpose 1] The purpose of this tutorial is to show how to create, and

More information

private string sconnection = ConfigurationManager.ConnectionStrings["Development"].ConnectionString

private string sconnection = ConfigurationManager.ConnectionStrings[Development].ConnectionString using System; using System.Configuration; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Text; using System.Windows.Forms;

More information