#DEVELOPMENT

Bagi anda yang bekerja sebagai developer software di lingkungan windows tentu mengenal dengan yang namanya Visual Studio,visual studio adalah IDE (Integrated Development Environment) yang dibuat oleh microsoft untuk membuat aplikasi-aplikasi berbasis ...

VISUAL BASIC

Microsoft Visual Basic (sering disingkat sebagai VB saja) merupakan sebuah bahasa pemrograman yang menawarkan Integrated Development Environment (IDE) visual untuk membuat program perangkat lunak berbasis sistem operasi Microsoft Windows dengan menggunakan model pemrograman (COM). Visual Basic merupakan turunan bahasa pemrograman BASIC dan menawarkan pengembangan perangkat...

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Selasa, 08 April 2014

Tugas 6

Soal

Protocol komunikasi di internet sangat bergantung pada format teks. Ketika anda melakukan browsing ke google.com, maka yang terjadi adalah pertukaran string teks terus-menerus antara router-router sampai dengan server google.

Misalnya awal dari protokol ditandai dengan karakter "abcde", akhir dari satu paket protokol ditandai dengan flag "edcba". Kemudian 2 byte berikutnya menunjukkan source port, diikuti 2 byte destination address. Lalu HLEN sebanyak 5 byte yang menunjukkan banyaknya data.
Setelah itu data sebanyak HLEN. Terdapat trailer 4 byte, sebelum ditutup CRC 4 byte. Buat programuntuk memisah-misahkan satu paket protokol. Misalnya data yang diterima dari internet sebagai berikut:

"*&(ikh)(abcde304900015halo apa kabar?okeh5986edcbaio test*0iou "

Program anda harus bisa mengambil satu paket protokol yang ditandai
dengan flag awal dan akhir protokol. Kemudian memisah-misahkan
source port, destination port, data dan trailer.


Jawab:

Design :



disini saya menggunakan textbox, button , label.

Program :

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace praktikum_7
{
    /// <summary>
    /// Description of MainForm.
    /// </summary>
    public partial class MainForm : Form
    {
        private int byte_2 = 2, byte_15 = 15, byte_5 = 5;
        private string str = "*&(ikh)(abcde304900015halo apa kabar?okeh5986edcbaio test*0iou";
      
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            protocol_box.Text = str;
          
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
        }
      
        void allfungsi()
        {
            string sp = str.Substring(13,byte_2);
            string dp = str.Substring(15,byte_2);
            string data = str.Substring(17,byte_5);
            string trailer = str.Substring(22,byte_15);
          
      
            source_box.Text=sp;
            destinationn_port.Text=dp;
            data_box.Text=data;
            trailer_box.Text=trailer;
        }
      
        void Button1Click(object sender, EventArgs e)
        {
            allfungsi();
        }
             
    }
}


Program running :




Video Tutorial  @youtube

Minggu, 06 April 2014

TUGAS 5

SOAL

BUATLAH FUNGSI DRAWLINE DAN HITUNGLAH LUASNYA!!

1.DESIGN :


2. PROGRAM :

namespace tugas_5
{
    /// <summary>
    /// Description of MainForm.
    /// </summary>
    public partial class MainForm : Form
    {
        private Graphics gr;
        private int x1, x2, y1, y2;
        private double luas;
        private Boolean painter;
       
       
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
           
            //
            // TODO: Add constructor codeh after the InitializeComponent() call.
            //
        }
       
        void MainFormLoad(object sender, EventArgs e)
        {
            gr = panel1.CreateGraphics();
        }
       
       
        void Panel1MouseDown(object sender, MouseEventArgs e)
        {
            if ( e.Button == MouseButtons.Left)
            {
                painter = true;
            }
           
            x1 = e.X;
            y1 = e.Y;
        }
       
        void Panel1MouseMove(object sender, MouseEventArgs e)
        {
            if ( painter == true )
            {
                panel1.Refresh();
                gr.DrawLinenew Pen ( Color.Red ),x1,y1,e.X,e.Y);
            }
        }
       
       
       
        void Panel1MouseUp(object sender, MouseEventArgs e)
        {
            x2 = e.X - x1;
            y2 = e.Y - y1;
            luas = Math.Sqrt ((x2 + x2 ) + ( y2 + y2 ));
            textBox1.Text=Convert.ToString(luas);
            painter = false;
        }
    }
}


3. RUN PROGRAM : 
 


VIDIO :

@YOUTUBE