Daha fazla
- Cinsiyet
- Erkek
- Meslek
- Active Directory - Security Uzmanı
- Profil Kapağı
- 1522600635
Kütüphanemize eklememiz gereken satırlar ;
Çağrılan Fonksiyon;
Fonksiyonu Tetikleme;
Kodların Tamamı;
Programın Proje Dosyasını Buradan İndirebilirsiniz
C#:
using System.Management;
using System.Net.NetworkInformation;
Çağrılan Fonksiyon;
C#:
public string MACAdresiAl()
{
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
String sMacAddress = string.Empty;
foreach (NetworkInterface adapter in nics)
{
if (sMacAddress == String.Empty) sMacAddress = adapter.GetPhysicalAddress().ToString();
textBox1.Text = (sMacAddress);
}
return sMacAddress;
}
Fonksiyonu Tetikleme;
C#:
private void button1_Click(object sender, EventArgs e)
{
MACAdresiAl();
}
Kodların Tamamı;
C#:
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.Management;
using System.Net.NetworkInformation;
namespace mac
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public string MACAdresiAl()
{
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
String sMacAddress = string.Empty;
foreach (NetworkInterface adapter in nics)
{
if (sMacAddress == String.Empty) sMacAddress = adapter.GetPhysicalAddress().ToString();
textBox1.Text = (sMacAddress);
}
return sMacAddress;
}
private void button1_Click(object sender, EventArgs e)
{
MACAdresiAl();
}
}
}
Programın Proje Dosyasını Buradan İndirebilirsiniz