assalamualaikum sahabat kali ini saya akan membuat program 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.
selamat mencoba :)
/*
* Created by SharpDevelop.
* User: tiaariyanti
* Date: 4/7/2014
* Time: 6:15 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace TUGAS_7
/*
* Created by SharpDevelop.
* User: tia ariyanti
* Date: 4/7/2014
* Time: 6:15 PM
*
* To change this template use Tools | Options
| Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace TUGAS_7
{
/// <summary>
/// Description of
MainForm.
/// </summary>
public partial class MainForm : Form
{
private string str = "*&(ikh)(abcde304900015halo apa
kabar?okeh5986edcbaio test*0iou";
private int bytesp_dp
= 2;
private int byte_data
= 5;
private int
byte_triler = 15;
public MainForm()
{
//
// The InitializeComponent() call is required for Windows
Forms designer support.
//
InitializeComponent();
str_tb.Text=str;
//
// TODO: Add constructor code after the
InitializeComponent() call.
//
}
void allfungsi()
{
string sp = str.Substring(13,bytesp_dp);
string dp = str.Substring(15,bytesp_dp);
string dt = str.Substring(17,byte_data);
string tr = str.Substring(22,byte_triler);
source_port.Text
= sp;
destination_port.Text
= dp;
Data.Text
= dt;
trailer.Text
= tr;
}
//void MainFormLoad(object sender, EventArgs e)
//{
//}
void Button1Click(object
sender, EventArgs e)
{
allfungsi();
}
private void
label5_Click(object sender, EventArgs e)
{
}
}
}
semoga bermanfaat :)
Comments
Post a Comment