Website and Host Address Ip Address Query Tool with C #

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@javatorman·
0.000 HBD
Website and Host Address Ip Address Query Tool with C #
Hello there!
Using the System.Net library with you today.
Türkçe:

Kendi bilgisayarımızın ip adresini ve metin kutusuna yazdığımız web sitesi adresinin ip adresini öğrendiğimizde ilk olarak yeni bir proje oluşturduk ve formumuza 2 metin kutusu, 2 etiket ve 1 düğme ekledik;
![Screenshot_1.jpg](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514852329/b0h9ug0zhakmyldg0jad.jpg)

Button Click olayımıza kod yazmaya başlamadan önce System.Net kitaplığımızı kodumuza eklemeliyiz.
```
using System.Net;
```
Sınıf ekledik
![Screenshot_2.jpg](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514852356/lprfwliewrzabmyqinye.jpg)

Ve Düğme Tıklama Etkinlik Kodları aşağıdaki gibidir;
```
textBox1.Text = ("Bilgisayar:" + Dns.GetHostName());
            foreach (IPAddress adres in Dns.GetHostAddresses(Dns.GetHostName()))
            {
                textBox2.Text = adres.ToString();
```

Kendi bilgisayarımızın adresini ve adını aldık. Yazdığımız web sitesinin ip adresini gösterecek kodları formumuzun devamı olarak yazalım.
Bunun için 2 etiketli 2 metin kutusu 1 düğmesi ekledik.
![Screenshot_3.jpg](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514852383/nvetidz8m5uilmtvkshv.jpg)


Ardından liste görünümündeki simgeyi tıklar ve düzenleme sütununa yazar ve ekle düğmesini iki kez tıklarız. Ve site adresini 1. sütun metne, 2. site metnini ise site lp adresine yazıyoruz.[Screenshot_4.jpg](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514852398/b6wfevc3wrsqbahptlub.jpg)
![Screenshot_5.jpg](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514852416/zzgatozwlkv064widhgg.jpg)


Button Click etkinliğine başlamadan önce size hatırlatmak isterim. Kullanıcının metin kutusuna yazdığı değer yanlışsa, steemit.com yerine stemit.com yazıp, daha sonra programı "try catch" bloğuna koyduğumuzu ve böylece "try" düğmesini tıkladığınızı ve programın otomatik olarak iki kez sekmeye bastığımızda bloğu tamamlayın.
If button 2 is click event,
```
private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                IPHostEntry siteadi = Dns.GetHostEntry(textBox4.Text);
                IPAddress[] ip = siteadi.AddressList;
                textBox3.Text = ip[0].ToString();
            }
            catch (Exception)
            {
                MessageBox.Show("Böyle Bir site Bulunamadı");
            }
        }
```
Codes Index;
![Screenshot_6.jpg](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514852454/f0oho613pbleteefpu8c.jpg)
![Screenshot_8.jpg](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514852452/g8nuhidd0rjfdeewagvv.jpg)
![Screenshot_7.jpg](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514852454/kxohfcxo6muqdrqevsdo.jpg)
Sonuç:
![Screenshot_9.jpg](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514852482/qafb6czpdlzlj0ewbmys.jpg)
If the website is misspelled, the result is;
![Screenshot_10.jpg](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514852489/henzgjz4kcb3n3sn6eln.jpg)

Github Profile And Link:
https://github.com/javatorman/Ipadresogren
![Screenshot_11.jpg](https://res.cloudinary.com/hpiynhbhq/image/upload/v1514852539/cbgo2e43je9rp3cpxoez.jpg)

I hope it has been a useful article thank you all.


<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@javatorman/website-and-host-address-ip-address-query-tool-with-c">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍 , , , , , , , , , , , ,