Read this article in your language IT | EN | DE | ES
Bu örnek dersimizde c# bir sitenin dns adresini nasıl gösteriz onu görelim
sadece form bir adet button bir adet textbox bir adet listbox control ekliyoruz
örnek projenin çıktısı :
kodumuz
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;
namespace dnscontrol
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string dnscontrol;
private void buttonX1_Click(object sender, EventArgs e)
{
dnscontrol = textBoxX1.Text;
IPAddress[] addresslist = Dns.GetHostAddresses(textBoxX1.Text);
foreach (IPAddress theaddress in addresslist)
{
listBox1.Items.Clear();
listBox1.Items.Add(theaddress.ToString());
textBoxX1.Text = "";
textBoxX1.Focus();
}
}
private void Form1_Load(object sender, EventArgs e)
{
textBoxX1.Focus();
}
}
}
Saygılarımla Orhan Türk Yen ibir örnek projede görüşmek üzere herkeze iyi calişmalar
fa7ffec6-3efc-40c8-9cb4-a1d332b566b7|1|4.0
c# dns control