using System;
using System.Net.NetworkInformation;
class MainClass {
static void Main() {
if (NetworkInterface.GetIsNetworkAvailable()) {
NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface ni in interfaces) {
Console.WriteLine(" Physical Address: {0}", ni.GetPhysicalAddress().ToString());
}
} else {
Console.WriteLine("No network available.");
}
}
}
Tag: Form
C# Programmation Réseau: Obtenir les statistic de IPV4
using System;
using System.Net.NetworkInformation;
class MainClass {
static void Main() {
if (NetworkInterface.GetIsNetworkAvailable()) {
NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface ni in interfaces) {
Console.WriteLine(" Bytes Sent: {0}", ni.GetIPv4Statistics().BytesSent);
}
} else {
Console.WriteLine("No network available.");
}
}
}
C# Programmation Réseau: Crypter les données à envoyé à travers les réseaux
atter = new SoapFormatter();
MemoryStream memstrm = new MemoryStream();
byte[] Key = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0
C# Programmation Réseau: Afficher la description de l’interface réseaux
using System;
using System.Net.NetworkInformation;
class MainClass {
static void Main() {
if (NetworkInterface.GetIsNetworkAvailable()) {
NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface ni in interfaces) {
Console.WriteLine(" Description: {0}", ni.Description);
}
} else {
Console.WriteLine("No network available.");
}
}
}
C# Programmation Réseau: Envoyer des données bianaires
35000.50;
emp2.EmployeeID = 2;
emp2.LastName = "B";
emp2.FirstName = "J";
emp2.YearsService = 9;
emp2.Salary = 23700.30;
T
C# Programmation Réseau: Obtenir l’adresse IP de l’hôte
ons of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistributions in binary fo
C# Programmation Réseau: Afficher l’état de fonctionnement d’une interface réseau.
using System;
using System.Net.NetworkInformation;
class MainClass {
static void Main() {
if (NetworkInterface.GetIsNetworkAvailable()) {
NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface ni in interfaces) {
Console.WriteLine(" Status: {0}", ni.OperationalStatus);
}
} else {
Console.WriteLine("No network available.");
}
}
}
C# Programmation Réseau: Afficher la fréquence de l’interface réseaux
using System;
using System.Net.NetworkInformation;
class MainClass {
static void Main() {
if (NetworkInterface.GetIsNetworkAvailable()) {
NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface ni in interfaces) {
Console.WriteLine(" Speed: {0}", ni.Speed);
}
} else {
Console.WriteLine("No network available.");
}
}
}
C# Programmation Réseau: Lire les données binaires
ient.GetStream();
IFormatter formatter = new BinaryFormatter();
SerialEmployee emp1 = (SerialEmployee)formatter.Deserialize(strm);
Console.Wr
C# Programmation Réseau: Accepter une demande de connexion en attente
rver.AcceptTcpClient();
NetworkStream stream = client.GetStream();
int i = stream.Read(bytes, 0, bytes.Length);