GEMTI18

______///////

Senin, 29 Juni 2015

Membuat Aplikasi Stopwatch Visual Studio

Aplikasi Stopwatch
Aplikasi Stopwatch
Aplikasi pengukur waktu untuk melakukan batasan, kecepatan, besaran waktu untuk melakukan pemberhentian/stop secara cepat dan akurat.

Daftar Komponen

Hasil Aplikasi Stopwatch
Rincian Codding

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.Diagnostics;


namespace Pertemuan1_AplikasiStopwatch
{
    public partial class Form1 : Form
    {
        private Stopwatch stopw = null;
        public Form1()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {
         
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (stopw != null)
            {
             
                label1.Text = stopw.Elapsed.ToString();
            }
        }

        private void Button1_Click(object sender, EventArgs e)
        {
        stopw = new Stopwatch();
        stopw.Start();
        Button1.Enabled = false;
        }

        private void Button2_Click(object sender, EventArgs e)
        {
            stopw.Stop();
            Button1.Enabled = true;
     

        }

        private void button3_Click(object sender, EventArgs e)
        {
            stopw.Reset();
            Button1.Enabled = true;
        }
    }
}

INGAT!!
Jika Anda kurang puas atau ingin menambahkan ide
Anda dapat mengkostumnya di Form/View code nya

Untuk keterangan lebih lanjut lihat slide
Download Slide
Download Program

Membuat Aplikasi Simple Notepad Visual Studio

Aplikasi Simple Notepad
Aplikasi Simple Notepad
Aplikasi seperti Notepad dengan ukuran dan fungsi yang sama tidak jauh berbeda, Anda dapat menulis rangkuman catatan anda dengan notepad yang lebih simple.

Daftar Komponen


Hasil Simple Notepad
Rincian Codding

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;

namespace Pertemuan2_AplikasiSimpleNotepad
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterScreen;
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
        }
        void bersih() // Disebut method atau function
        {
            rtb_input.Text = "";
        }
        void bukafile() // Disebut method atau function
        {
            bersih();
            OpenFileDialog buka = new OpenFileDialog();
            buka.DefaultExt = "txt";

            buka.Filter = "Text Document| *.txt";

            buka.FileName = "";

            if (buka.ShowDialog() != DialogResult.Cancel)
            {
                string fileTerpilih = buka.FileName;
                if (fileTerpilih != "")
                {
                    rtb_input.LoadFile(fileTerpilih, RichTextBoxStreamType.PlainText);
                }
             }
         }
        void simpanfile()
        {
            SaveFileDialog simpan = new SaveFileDialog();
            simpan.Filter = " Text Document | *.txt";
            simpan.RestoreDirectory = true;
            if (simpan.ShowDialog() != DialogResult.Cancel)
            {
                StreamWriter filesimpan = new StreamWriter(File.Create(simpan.FileName));
                filesimpan.Write(rtb_input.Text);
                filesimpan.Dispose();
            }

        }

        private void btn_buka_Click(object sender, EventArgs e)
        {
            if (rtb_input.Text != "")
            {
                var pesan = MessageBox.Show("File belum tersimpan, yakin ingin membuka file baru???", "Konfirmasi", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (pesan == DialogResult.Yes)
                {
                    bukafile();
                }
            }
            else
            {
                bukafile();
            }
     
        }

        private void btn_simpan_Click(object sender, EventArgs e)
        {
            {
                simpanfile();
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            bersih();
        }    
    }
}

INGAT!!
Jika Anda kurang puas atau ingin menambahkan ide
Anda dapat mengkostumnya di Form/View code nya

Untuk keterangan lebih lanjut lihat slide
Download Slide
Download Program

Membuat Aplikasi Image Resizer Visual Studio

Aplikasi Image Resizer
Aplikasi Image Resizer
Sebuah Aplikasi Foto untuk mengkompresi gambar menjadi lebih kecil dalam ukuran yang akurat

Gambar ukuran Asli

Daftar Komponen


Hasil Image Resizer
Rincian Codding

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;

namespace pert2_aplikasi_image_resizer
{
    public partial class bbuka : Form
    {
        private Image gambar;
        public bbuka()
        {
            InitializeComponent();
            tsize.MaxLength = 3;
            tsize.Enabled = false;
        }

        void ubahsize()
        {
            if (tsize.Text != "")
            {
                int persen = Convert.ToInt32(tsize.Text);
                int tinggi = (persen * Convert.ToInt32(ltinggi.Text)) / 100;
                int lebar = (persen * Convert.ToInt32(llebar.Text)) / 100;
                ltinggi.Text = Convert.ToString(tinggi);
                llebar.Text = Convert.ToString(lebar);
            }
        }
        void simpangambar()
        {
            int tinggi = Convert.ToInt32(ltinggi.Text);
            int lebar = Convert.ToInt32(llebar.Text);
            Bitmap ukuranbaru = new Bitmap(lebar, tinggi, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
            Graphics gbr = Graphics.FromImage(ukuranbaru);
            gbr.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighSpeed;
            gbr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed;
            gbr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
            gbr.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighSpeed;
            Rectangle rect = new Rectangle(0, 0, lebar, tinggi);
            gbr.DrawImage(gambar, rect);
            SaveFileDialog simpan = new SaveFileDialog();
            simpan.Filter = "Jpeg Format|*.Jpg";
            simpan.RestoreDirectory = true;

            if (simpan.ShowDialog() != DialogResult.Cancel)
            {
                ukuranbaru.Save(simpan.FileName);
                ukuranbaru.Dispose();
                MessageBox.Show("Gambar Berhasil Disimpan", "info");
            }
        }
        void bukagambar()
        {
            OpenFileDialog bukagambar = new OpenFileDialog();
            if (bukagambar.ShowDialog() == DialogResult.OK)
            {
                this.gambar = Image.FromFile(bukagambar.FileName);
                picture.SizeMode = PictureBoxSizeMode.StretchImage;
                picture.ImageLocation = bukagambar.FileName;
                ltinggi.Text = gambar.Height.ToString();
                llebar.Text = gambar.Width.ToString();
                tsize.Enabled = true;
                tsize.Clear();
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            bukagambar();
        }

        private void tsize_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                ubahsize();
            }
        }

        private void bsimpan_Click(object sender, EventArgs e)
        {
            simpangambar();
     

        }
    }
}

INGAT!!
Jika Anda kurang puas atau ingin menambahkan ide
Anda dapat mengkostumnya di Form/View code nya

Untuk keterangan lebih lanjut lihat slide
Download Slide
Download Program

Membuat Aplikasi Ftp Visual Studio

Aplikasi Ftp
Aplikasi Ftp
File Transfer Protokol (FTP) adalah suatu protokol yang berfungsi untuk tukar-menukar file dalam suatu network yang men-support TCP/IP protokol. Dua hal penting yang ada dalam FTP adalah FTP server dan FTP Client. FTP server menjalankan software yang digunakan untuk tukar menukar file, yang selalu siap memberian layanan FTP apabila mendapat request dari FTP client. FTP client adalah komputer yang request koneksi ke FTP server untuk tujuan tukar-menukar file (upload dan download file).

Daftar Komponen


Rincian Codding

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.Net;
using System.IO;

namespace Aplikasi_ftp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        // Upload the text.

        private void btnUpload_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                lblStatus.Text = "Working...";
                Application.DoEvents();

                ftpUploadstring(DateTime.Now.ToString() + ":" + txtText.Text, txtUrl.Text, txtUsername.Text, txtPassword.Text);

                lblStatus.Text = "Done";
            }
            catch (Exception ex)
            {
                lblStatus.Text = "Error";
                MessageBox.Show(ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
        // Use FTP to upload a string into a file.
        private void ftpUploadstring(string text, string to_url, string user_name, string password)
        {
            // Get the object used to communicate with the server.
            FtpWebRequest request = (FtpWebRequest)WebRequest.Create(to_url);

            // Write the text's btes into the request stream.
            request.ContentLength = text.Length;
            using (Stream request_stream = request.GetRequestStream())
            {
                byte[] bytes = Encoding.UTF8.GetBytes(text);
                request_stream.Write(bytes, 0, text.Length);
                request_stream.Close();
            }
        }
    }
}


INGAT!!
Jika Anda kurang puas atau ingin menambahkan ide
Anda dapat mengkostumnya di Form/View code nya

Untuk keterangan lebih lanjut lihat slide
Download Slide
Download Program

Minggu, 28 Juni 2015

Membuat Aplikasi Deteksi Device Manager Visual Studio


Aplikasi Deteksi Device Manager
Aplikasi Deteksi Device Manager
Sebuah aplikasi yang menampilkan data hardware atau komponen lain yang berfungsi ketika kita menjalankan salah satu akses pada jaringan yang dipakai. 


Layout/Interface



Rincian Codding

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.Net.NetworkInformation;
using System.Collections;

namespace pert4_Aplikasi_Deteksi_Device_Manager
{
    public partial class Form1 : Form
    {
        private NetworkInterface[] nicArr;
        public Form1()
        {
            InitializeComponent();
            InitializeNetworkInterface();
        }

        public void InitializeNetworkInterface()
        {
            nicArr = NetworkInterface.GetAllNetworkInterfaces();

            for (int i = 0; i < nicArr.Length; i++)
            {
                comboBox1.Items.Add(nicArr[i].Name);
            }
            comboBox1.SelectedIndex = 0;
        }

        public void networkproc()
        {
            NetworkInterface nic = nicArr[comboBox1.SelectedIndex];//Secara otomatis network interface yang ada akan terdaftar pada ComboBax1
            IPGlobalProperties global_propertise = IPGlobalProperties.GetIPGlobalProperties();
            ArrayList info = new ArrayList();

            info.Add("Interface Information for: " + global_propertise.HostName + global_propertise.DomainName);
            info.Add("NetBIOS node type : " + global_propertise.NodeType);
            info.Add("================================================== ");
            info.Add("Name: " + nic.Name); info.Add("Description : " + nic.Description);
            info.Add("Network Interface Type : " + nic.NetworkInterfaceType);
            info.Add("Physical Address : " + nic.GetPhysicalAddress().ToString());// Info MAC Address yang di pakai
            info.Add("Adapter ID: " + nic.Id.ToString());
            info.Add("Receive Only: " + nic.IsReceiveOnly.ToString());
            info.Add("Status : " + nic.OperationalStatus.ToString());
            info.Add("Speed : " + nic.Speed.ToString());
            IPInterfaceProperties properties = nic.GetIPProperties();
            info.Add("Properties: "); info.Add(" |DNS Addresses : ");

            foreach (IPAddressInformation uniCast in properties.UnicastAddresses)
                info.Add(" -> : " + uniCast.Address.ToString());
            info.Add(" | AnyCast Addresses: ");
            foreach (IPAddressInformation anycast in properties.AnycastAddresses)
                info.Add(" -> : " + anycast.Address.ToString());
            info.Add(" |Support multi-cast : " + nic.SupportsMulticast.ToString());
            info.Add(" |Multicast Addresses: ");
            foreach (IPAddressInformation multicast in properties.MulticastAddresses)
                info.Add(" -> : " + multicast.Address.ToString());
            info.Add(" |Gateway Addresses : ");
            foreach (GatewayIPAddressInformation gateway in properties.GatewayAddresses)
                info.Add(" -> : " + gateway.Address.ToString());

            if (nic.Supports(NetworkInterfaceComponent.IPv4) == true)
            {
                IPv4InterfaceProperties ipv4props = properties.GetIPv4Properties();
                info.Add("+IPV4 Properties : ");
                if (ipv4props != null)
                {
                    info.Add(" |Interface Index : " + ipv4props.Index.ToString());
                    info.Add(" |Automatic Private Addressing Active : " + ipv4props.IsAutomaticPrivateAddressingActive.ToString());
                    info.Add(" |Automatic Private Addressing Enabled : " + ipv4props.IsAutomaticPrivateAddressingEnabled.ToString());
                    info.Add(" |DHCP Enabled : " + ipv4props.IsDhcpEnabled.ToString());
                    info.Add(" |Forwadding Enabled: " + ipv4props.IsForwardingEnabled.ToString());
                    info.Add(" |MTU Size : " + ipv4props.Mtu.ToString());
                    info.Add(" |\\Uses Wins : " + ipv4props.UsesWins.ToString());
                }
                else
                {
                    info.Add(" |Device has no Ipv4 properties : ");
                }
            }
            else
            {
                info.Add(" |+IPv4 is not implemented : ");
            }
            if (nic.Supports(NetworkInterfaceComponent.IPv6) == true)
            {
                IPv6InterfaceProperties ipv6props = properties.GetIPv6Properties();
                info.Add(" +IPV6 Properties : ");
                if (ipv6props != null)
                {
                    info.Add(" +IPV6 Properties : ");
                    info.Add(" |Interface Index : " + ipv6props.Index.ToString());
                    info.Add(" \\MTU Size : " + ipv6props.Mtu.ToString());
                }
                else
                {
                    info.Add(" |Device has no IPV6 properties");
                }
            }
            else
            {
                info.Add(" +IPV6 is not Implemented");
            }
            foreach (string a in info)
            {
                listBox1.Items.Add(a);
            }
        }

        private void bget_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
            networkproc();
        }
    }
}


Hasil Aplikasi Deteksi Device Manager

INGAT!!
Jika Anda kurang puas atau ingin menambahkan ide
Anda dapat mengkostumnya di Form/View code nya

Untuk keterangan lebih lanjut lihat slide
Download Slide
Download Program

Membuat Aplikasi Bandwith Visual Studio

Aplikasi Bandwith
Aplikasi Bandwith
Menampilkan suatu nilai ukuran data bandwith yang di lakukan secara Online dalam melakukan aktivitas internet. yaitu menampilkan Speed/Received/Upload/Download.

Hasil Aplikasi Bandwith




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.Net.NetworkInformation;

namespace pert4_Aplikasi_Bandwidth
{
    public partial class Form1 : Form
    {
        public const double waktu_update = 1000;
        private NetworkInterface[] network_interface;
        public Timer timer;
        public Form1()
        {
            InitializeComponent();
            InitializeNetworkInterface();
            Timer_intial();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            timer.Stop();
        }
        public void InitializeNetworkInterface()
        {
            network_interface = NetworkInterface.GetAllNetworkInterfaces();

            for (int i = 0; i < network_interface.Length; i++)
            {
                comboBox1.Items.Add(network_interface[i].Name);
            }
            comboBox1.SelectedIndex = 0;

        }
        long lngBytesSend;
        long lngBytesReceived;

        public void proc()
        {
            NetworkInterface NIC = network_interface[comboBox1.SelectedIndex];
            IPv4InterfaceStatistics status = NIC.GetIPv4Statistics();
            int sent_Speed = (int)(status.BytesSent - lngBytesSend) / 1024;
            int received_speed = (int)(status.BytesReceived - lngBytesReceived) / 1024;

            label8.Text = (NIC.Speed / 1000000) + "Mbps";
            label10.Text = status.BytesReceived.ToString();
            label9.Text = status.BytesSent.ToString();
            label12.Text = (sent_Speed).ToString() + "KB/s";
            label11.Text = (received_speed).ToString() + "KB/s";
            lngBytesSend = status.BytesSent;
            lngBytesReceived = status.BytesReceived;
        }
        public void clear()
        {
            label8.Text = "0";
            label9.Text = "0";
            label10.Text = "0";
            label11.Text = "0";
            label12.Text = "0";
        }

        public void Timer_intial()
        {
            timer = new Timer();
            timer.Interval = (int)waktu_update;
            timer.Tick += new EventHandler(Update_waktu);
        }
        void Update_waktu(object sender, EventArgs e)
        { proc(); }

        private void button1_Click(object sender, EventArgs e)
        {
            { timer.Start(); }
        }


        private void button2_Click(object sender, EventArgs e)
        {
            {
                timer.Stop();
                clear();
            }
        }
    }
}



INGAT!!
Jika Anda kurang puas atau ingin menambahkan ide
Anda dapat mengkostumnya di Form/View code nya

Untuk keterangan lebih lanjut lihat slide
Download Slide
Download Program


Selamat mencoba,
Semoga Bermanfaat.

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More