Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

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#: Vérifier si l’état de connexion a changé avec ADO Event

{filelink=19655}
static void Main(string[] args)
 {
 public static void OnStateChange(object sender,
    System.Data.StateChangeEventArgs ef)
{
 // Afficher le message sur le console
     Console.WriteLine("l'état de connexion à changé: {0}"

Les événements Compatible .Net

{filelink=15055}
class="codeShade">
/*
C#: The Complete Reference
by Herbert Schildt 
 
Publisher: Osborne/McGraw-Hill (March 8, 2002)
ISBN: 0072134852
*/
 
// A

Gestion des événements d’un bouton

{filelink=14650}
 
using System;
using System.Windows.Forms;
using System.Drawing; 
 
public class TextBouton : Form {
  Button textBouton = new Button(); 
 
  pub

Afficher une image dans un Form

{filelink=14621}
  using System;
  using System.Drawing;
  using System.Drawing.Drawing2D;
  using System.Collections;
  using System.ComponentModel;
  using Sy

Exemple PictureBox: Affichage des images en diverses dimensions

{filelink=14622}
 
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
 
nam

Exemple d’utilisation des ‘Anchor’ et ‘Dock’

{filelink=14633}
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
 
clas

Rendre un Form Transparent

{filelink=14623}
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
 
namespace TransparentFo

Traitement d’image: Animer une image avec les classes ‘Bitmap’, ‘DrawImage’ et ‘ImageAttributes’

{filelink=14635}
 
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Collections;
using System.Compo

Fenêtre MDI: Dimension cascade et Mosaïque

{filelink=14624}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using