SocketType);
Console.WriteLine("ProtocolType: {0}",test.ProtocolType);
Console.WriteLine("Blocking: {0}", test.Blocking);
test.Blocking = fa
C# Programmation Réseau: Envoyer un email en format HTML à plusieurs destinataires
t = "This is a fancy test message";
mm.Headers.Add("Reply-To", "haley@myisp.net");
mm.Headers.Add("Comments", "This is a test HTML message");
C# Programmation Réseau: Résolution des DNS en CSharp
"Enter address to resolve:";
label1.AutoSize = true;
label1.Location = new Point(10, 10);
address = new TextBox();
address.Parent = th
C# Programmation Réseau: Exemple de Connexion à un Serveur Mail
ailclient;
private NetworkStream ns;
private StreamReader sr;
private StreamWriter sw;
public PopCheck()
{
Text = “popcheck – A POP3 e-mai
C#: Supprimer des caractères au début et à la fin d’un String
![]() |
Console.WriteLine(texte.Trim(new char[1] {'-'})); // Résultat: "Allô"
texte = ",-Allô-,-";
Console.WriteLine(texte.Trim(new char[2] {'-',','})); // Résultat: "Allô"
|
C#: Inverser une chaîne de Caractère(String)
![]() |
public static String reverseString(String texte)
{
string reverseStr = "";
for (int counter = texte.Length - 1; counter >= 0; counter--)
{
|
C#: Encoder les données binaires en Base64
![]() |
if ((byteLength % 4) != 0)
{
byteLength += 4 - (byteLength % 4);
}
char[] encodedCharArray = new char[byteLength];
Convert.ToBase64CharArray(sourceBytes, 0, sourceBytes.Length, encodedCharArray, 0);
|
C#: Convertir un tableau d’octet UTF-16 en String
![]() |
public static string UTF16ByteArrayToString(byte[] characters)
{
UnicodeEncoding encoding = new UnicodeEncoding();
string resultString = encoding.GetString(characters);
return (resultString);
}
|
C#: Convertir un tableau d’octet en String
![]() |
public static string ByteArrayToString(byte[] characters)
{
ASCIIEncoding encoding = new ASCIIEncoding();
string resultString = encoding.GetString(characters);
|