Active directory C#

Posted: 8th mai 2012 by ahabrimonssif in Active directory, C#

Premièrement ajouter cela : using System.DirectoryServices;
Pour chercher existence d’un user dans Active directory:

  public bool UserExists(string ldappath, string user, string pass)
        {

                DirectoryEntry de = GetDirectoryEntry(ldappath, user, pass);
                DirectorySearcher deSearch = new DirectorySearcher();
                deSearch.SearchRoot = de;

                deSearch.Filter = "(&(objectClass=user) (cn=" + user + "))";
                SearchResultCollection results = deSearch.FindAll();

                if (results.Count > 0)
              return true;
          else
               return false;
}

pour appelle de cette méthode : le nom du domaine xxx.yyy.zz

          if(UserExists("LDAP://adresseServer/DC=xxx;DC=yyy;DC=zz",UserName, Password)

terminale calculatrice multi-integer

Posted: 27th juillet 2011 by ahabrimonssif in Microsoft




Reveille WPF

Posted: 27th juillet 2011 by ahabrimonssif in C#, Microsoft, wpf
Tags: ,

Sudoku en langage c

Posted: 27th juillet 2011 by ahabrimonssif in Actualité, Microsoft
Tags: , ,

/////////////////////////////////////////////////////////////////////////////
//                                                                           //
//                                                                           //
// Programme du jeux su-do-ku  REALISER PAR : AHABRI MONSSIF                 //
//                                                                      //
/////////////////////////////////////////////////////////////////////////////

#include <graphics.h>
#include<dos.h>
#include<stdio.h>
#include<conio.h>
#include<stdlib.h> // pour utilisez  la fonction atoi():::
#include<ctype.h> // utilisez la fonction  isdigit():: teste si le caractere est numerique
#include<math.h>

/////////////////////////////////////////////////////////////////////////////////

#define HAUT 0x48  //  les code en hexadecimal du curseur en utilisant les fleches du clavier
#define BAS 0x50
#define ECHAP 27
#define GAUCHE 0x4B
#define DROITE 0x4D
#define AVTIVER_AIDE  59
#define DESACTIVER_AIDE 60
#define SOLUTION 61
#define CHANGER_COULEUR 62
#define HELP 63
#define CREATION 64

typedef struct { //utilez dans la fct deplacement du curseur
	   int xi;
	   int yi;
	   } dep;

int t[9][9];
int F[9][9];
	  //ce tableau utilisez pour les couleurs

	  //variables global

	 // les prototype

void curseur(int);
void initialise(int t[9][9] );
int  colonnes(int t[9][9],int,int,int);
int  ligne(int t[9][9],int,int,int);
int retourdebut(int);
int retourfin(int);
int  indicey(int);
int  indicex(int);
int verifie(int t[9][9],int ,int ,int);
int valide(int t[9][9],int,int,int);
void grille(int);
void affiche(void);
int calcul(int ,int );
int aff_message_activation_de_l_aide_au_debut(void);
dep deplacement_curseur(int ,dep );
int quitte_le_jeux(int ,int ,int);
void return_a_la_grille(int ,int,int );
void solution(void);
int message_aide_activer(int ,int );
int message_aide_desactiver(int ,int );
int changer_couleur_de_la_grille(void);
void help_sudoku(void);
void creation(void);
void inter(void);
void titre_sudoku(void);
void retour_a_la_case( int m[9][9],int * , int *);
void back(int t[9][9],int *, int * );
void sudo(int t[9][9]);

/////////////////////////////////////////////////////////////////////////////////////////
//                                                                                    //
//                   PROGRAMME PRINCIPALE
//////////////////////////////////////////////////////////////////////////////////
void main(void)

{

 int couleur=0 /* 0: c'est la couleur noir */,active_aide;   // pour activer l aide
 int indice_d_aide=0,position_de_x=5;
 int convertie_en_entier,position_de_y=4;
 int i,j,indice=0;
 char getch_1,getch_2,mon[2];
 dep position;
  int tt=10,ff=10;

 inter();  // afficher introduction
 clrscr();
 curseur(0);
 textbackground(BLUE);
 clrscr();
 grille(couleur);
 initialise(t);
 indice_d_aide=aff_message_activation_de_l_aide_au_debut(); // le premier message  activation
 textbackground(BLUE);
 curseur(1);
 clrscr();
 grille(couleur);
 textcolor(15);
 gotoxy(5,4);
	position.xi = 5;
	position.yi = 4;

  do
   {
	   textcolor(15);   // couleur du text
	   textbackground(couleur); // couleur du fond
	   getch_1 = getch();
	   if( iscntrl( getch_1) ) // les touche de controle
			{
			switch(getch_1)
			  {
				 case 0:{
							 getch_2=getch();

							  if( getch_2 == HAUT || getch_2==BAS || getch_2==GAUCHE || getch_2==DROITE )

									{

									   position = deplacement_curseur(getch_2,position);

									   position_de_x = position.xi;

									   position_de_y = position.yi;

								   }
							 else

							 if( getch_2 == AVTIVER_AIDE )    //  pour dire que l aide est activer c a d une forme boolean  pour test‚

								indice_d_aide = message_aide_activer(position_de_x,position_de_y);

							 else

								if(getch_2 == DESACTIVER_AIDE)  // L' aide desactive‚

								  indice_d_aide = message_aide_desactiver(position_de_x,position_de_y);

							   else

								if(getch_2 == SOLUTION)  // pour la solution de la grille
								  {
									 curseur(0);// desactiver le curseur
									 if(indice == 0 )
									   {
										 solution();
										}
									 else
									 {
									   gotoxy(3,23);printf("GRILLE NA PAS DE SOLUTION");}
									   indice=0;
									   getch();
									   titre_sudoku();
									   getch();
									   // retour a la grille initiale
									   textbackground(BLUE);
									   clrscr();
									   return_a_la_grille(position_de_x,position_de_y,couleur);
									   curseur(1);// allumer le curseur
									 }
								else
								  if(getch_2 == CHANGER_COULEUR)
									{
									   // la trace de la grille
									   textbackground(RED);
									   clrscr();
									   couleur = changer_couleur_de_la_grille();
									   textbackground(BLUE);
									   clrscr();
									   return_a_la_grille(position_de_x,position_de_y,couleur);

									}
									else
								  if(getch_2 == HELP)
									{
											 // la trace de la grille
									   textbackground(RED);
									   clrscr();
									   help_sudoku();
									   getch();
									   curseur(1);
									   textbackground(BLUE);
									   clrscr();
									   return_a_la_grille(position_de_x,position_de_y,couleur);

									}
										else
								  if(getch_2 == CREATION)
									{
									   // la trace de la grille
									   textbackground(RED);
									   clrscr();
									   creation();
									   getch();
									   textbackground(BLUE);
									   clrscr();
									   return_a_la_grille(position_de_x,position_de_y,couleur);

									}
					   }// end case 0
				   }// end switch
			 }// end if iscntrl
	 else
	 if (isdigit(getch_1))           // traitement  dans le cas que sont des nombre

	  {       i = indicey(position_de_y);

			  j = indicex(position_de_x);

			  mon[0] = getch_1;

			  mon[1] = '\0';

			  convertie_en_entier=atoi(mon); // convertir une char a un entier

			 if(convertie_en_entier == 0) // pour suprimmer un nombre
					 {	   t[i][j] = 0 ;
						   F[i][j] = 0;
						   cprintf(" ");
						   putchar(8);
					  }
			  else
			  if(convertie_en_entier>0 && convertie_en_entier<=9)    // le cas que n entre 0 et 9
				   {
				   if(indice_d_aide == 1)// si aide est activer en entre dans ce cas
					{

						 if( ( ligne(t,i,j,convertie_en_entier)==0 ) && ( colonnes(t,i,j,convertie_en_entier)==0) &&  ( verifie(t,convertie_en_entier,i,j)==0 )  )// traitement pour verifier si ce nombre n existe dans la grille
						 {
						   t[i][j] = convertie_en_entier ;     // partie aide activ‚‚

						   F[i][j] = convertie_en_entier;     // ceci est ajout‚ pour mettre en point  les couleur des entr‚

						   textcolor(YELLOW);

						   cprintf("%d",convertie_en_entier);// affich‚ dans la grille

						   putchar(8);     // LE RETOUR D UNE CASE EN ARRIRE
						 }

						 else
						  {

						   }
					}
				 else
					{    // partie l'aide d‚sactiver
						if((ff==j)&&(tt==i)) indice=0;
					  if( ( ligne(t,i,j,convertie_en_entier)!=0 ) || ( colonnes(t,i,j,convertie_en_entier)!=0) ||  ( verifie(t,convertie_en_entier,i,j)!=0 )  )// traitement pour verifier si ce nombre n existe dans la grille
						 {
						   indice=1;
						   tt=i;
						   ff=j;
						  }

					  t[i][j] = convertie_en_entier ;
					  F[i][j] = convertie_en_entier ;

					  textcolor(YELLOW);
					  cprintf("%d",convertie_en_entier);// affiche dans la grille
					  putchar(8);

					}
		   }//end  if de ca convertie_en_entier<9 convertie_en_entier>0

	} //end if isdigit

	 if(getch_1 == ECHAP) {
							  curseur(0); // c'est ECHAP pour quitt‚ le jeux
							  getch_1=quitte_le_jeux(position_de_x,position_de_y,couleur);
							  curseur(1);
						  }

  }             //end while
 while(getch_1!=ECHAP);
}

///////////////////////////////////////////////////////////////////////////////
//pour afficher curseur -> curseur(1);

//pour desactiver curseur -> curseur(0);

///////////////////////////////////////////////////////////////////////////////

void curseur(int  curseur_on)
{
 int  d,f;
 union REGS rin,rout;

 if(curseur_on)
   {
	 d=3;f=4;
   }
 else
   {
		d=17;f=16;
	}

   rin.h.ch=d;
   rin.h.cl=f;
   rin.h.ah=1;
   int86(0x10,&rin,&rout);
}

/////////////////////////initialisez la grilles a zero ////////////////////

void initialise(int t[9][9]){
	 int i ,j;
	 for(i=0;i<9;i++)
	   for(j=0;j<9;j++)
			t[i][j]=0;
}

////////////////////////////////////////////////////////////////////////////
//                                                                        //
//         traitement colonnes de sudoku fixant le j est parcourant en i //
//                                                                       //
//////////////////////////////////////////////////////////////////////////

int  colonnes(int t[9][9],int i,int j,int element)
{
		 int k,trouve=0;
	 for(k=0;k<9;k++)
	   if(abs(t[k][j])==element && i!=k )

				trouve=1; // ELEMENT TROUVE DANS LA COLONNE
  return trouve;
 }
///////////////////////////////////////////////////////////////////////////
//                                                                      //                         //
//                    Traitement dans LES lignes de sudoku              //
//                                                                      //                       //
/////////////////////////////////////////////////////////////////////////

int  ligne(int t[9][9],int i,int j,int element)
{

 int k,trouve=0;

	 for(k=0;k<9;k++)
	   if(abs(t[i][k])==element && j!=k )
					  trouve=1;
return trouve;

}
///////////////////////////////////////////////////////////////////////////////
//                                                                           //
//                        DEBUT DE LA REGION                                 //
//                                                                           //
//////////////////////////////////////////////////////////////////////////////

int retourdebut(int x){

int i;

switch(x){
		   case 0:
		   case 1:
		   case 2:return 0;
		   case 3:
		   case 4:
		   case 5:return 3;
		   case 6:
		   case 7:
		   case 8:return 6;
		}
}

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
//                        FIN DE LA REGION                                  //
//                                                                         //
////////////////////////////////////////////////////////////////////////////
int retourfin(int y){

 int i;

	switch(y){
		   case 0:
		   case 1:
		   case 2:return 2;
		   case 3:
		   case 4:
		   case 5:return 5;
		   case 6:
		   case 7:
		   case 8:return 8;
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                               /
//  Cette fonction nous donne une convertion du gotoxy a indice du tableaux ce qui concerne le i /
//                                                                                               /
//////////////////////////////////////////////////////////////////////////////////////////////////

int  indicey(int y)
{
 int i;

 if (y==4)
	 {
	  i=0;

	 }
	  if(y>4)
	 {
	i=0;
	   do{
		  y=y-2;
		  i++;
	  }
	  while(y!=4);

	 }
return i;
}
////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                              /
// cette fonction nous donne une convertion du gotoxy a indice du tableaux ce qui concerne le j /
//                                                                                              /
////////////////////////////////////////////////////////////////////////////////////////////////
int indicex(int x)
{
 int j;
 if (x==5){
		j=0;

	  }

  if (x>5)
	{
	 j=0;
	  do{
		 x=x-4;
		 j++;
	}
	  while(x!=5);
	 }
return j;
}
///////////////////////////////////////////////////////////////////////////////
//                                                                           //
//                        VERIFICATION DANS LES REGION                      //
//                                                                         //
////////////////////////////////////////////////////////////////////////////

int verifie(int t[9][9],int element,int i,int j){

int k,f,l=0 ;

  int ki,kj,li,lj;

  ki=retourdebut(i);
  li=retourfin(i);    // pour l intervalle  i voir sont debut est ca fin

  kj=retourdebut(j);
  lj=retourfin(j);

  for(k=ki;k<=li;k++)
		for(f=kj;f<=lj;f++)
		 if(abs(t[k][f])==element && k!=i && f!=j) {l=1;}

return l;
 }
/////////////////////////////////////////////////////////////////////////////
//                                                                            /
//                             affichage de la grille                        /
//                                                                            /
//////////////////////////////////////////////////////////////////////////////
void grille(int couleur)

{
 int i,j;

 textbackground(18);
 textcolor(BLACK);
 textattr(3);
 gotoxy(2,1);cprintf("  ECHAP:");
 textcolor(15);
 gotoxy(10,1);cprintf("Quitter le jeux ");
 textcolor(BLACK);
 textattr(3);
 gotoxy(32,1);cprintf(" F1:");
 textcolor(15);
 gotoxy(36,1);cprintf(" L'AIDE ACTIVER ");
 textcolor(BLACK);
 textattr(3);
 gotoxy(55,1);cprintf(" F2:");
 textcolor(15);
 gotoxy(59,1);cprintf(" L'AIDE DESACTIVER");
 textcolor(BLACK);
 textattr(3);
 gotoxy(49,7);cprintf("F3:");
 textcolor(15);
 gotoxy(52,7);cprintf(" SOLUTION DE LA GRILLE");
 textcolor(BLACK);
 textattr(3);

 gotoxy(49,9);cprintf("F4:");
 textcolor(15);
 gotoxy(52,9);cprintf(" CHANGER LA COULEUR   ");
 gotoxy(49,10);cprintf("     DE LA GRILLE        ");
 textcolor(BLACK);
 textattr(3);

 gotoxy(49,12);cprintf("F5:");
 textcolor(15);
 gotoxy(52,12);cprintf(" HELP                 ");
 textcolor(BLACK);
 textattr(3);

 gotoxy(49,14);cprintf("F6:");
 textcolor(15);
 gotoxy(52,14);cprintf(" CE JEUX CREE PAR     ");

 textbackground(0);
 textbackground(BLUE);

 for(i=0;i<24;i++)
 {
 gotoxy(43,2+i);cprintf("³");
 }
 for(i=0;i<80;i++) {
 gotoxy(1+i,2);cprintf("Ä");}
 for(i=0;i<36;i++) {
 gotoxy(44+i,23);cprintf("Ä");}
 textbackground(0);
 textcolor(15);     /*  Æ  Ï      ×=(215) Ð(208) Ò(210)    */
 textbackground(couleur);
 gotoxy(3,3);cprintf("ÚÄÄÄÂÄÄÄÂÄÄÄÒÄÄÄÂÄÄÄÂÄÄÄÒÄÄÄÂÄÄÄÂÄÄÄ¿\n");
 gotoxy(3,4);cprintf("³   ³   ³   º   ³   ³   º   ³   ³   ³\n");
 gotoxy(3,5);cprintf("ÃÄÄÄÅÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄÅÄÄÄ´\n");
 gotoxy(3,6);cprintf("³   ³   ³   º   ³   ³   º   ³   ³   ³\n");
 gotoxy(3,7);cprintf("ÃÄÄÄÅÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄÅÄÄÄ´\n");
 gotoxy(3,8);cprintf("³   ³   ³   º   ³   ³   º   ³   ³   ³\n");
 gotoxy(3,9);cprintf("ÆÍÍÍØÍÍÍØÍÍÍÎÍÍÍØÍÍÍØÍÍÍÎÍÍÍØÍÍÍØÍÍ͵\n");
 gotoxy(3,10);cprintf("³   ³   ³   º   ³   ³   º   ³   ³   ³\n");
 gotoxy(3,11);cprintf("ÃÄÄÄÅÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄÅÄÄÄ´\n");
 gotoxy(3,12);cprintf("³   ³   ³   º   ³   ³   º   ³   ³   ³\n");
 gotoxy(3,13);cprintf("ÃÄÄÄÅÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄÅÄÄÄ´\n");
 gotoxy(3,14);cprintf("³   ³   ³   º   ³   ³   º   ³   ³   ³\n");
 gotoxy(3,15);cprintf("ÆÍÍÍØÍÍÍØÍÍÍÎÍÍÍØÍÍÍØÍÍÍÎÍÍÍØÍÍÍØÍÍ͵\n");
 gotoxy(3,16);cprintf("³   ³   ³   º   ³   ³   º   ³   ³   ³\n");
 gotoxy(3,17);cprintf("ÃÄÄÄÅÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄÅÄÄÄ´\n");
 gotoxy(3,18);cprintf("³   ³   ³   º   ³   ³   º   ³   ³   ³\n");
 gotoxy(3,19);cprintf("ÃÄÄÄÅÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄÅÄÄÄ×ÄÄÄÅÄÄÄÅÄÄÄ´\n");
 gotoxy(3,20);cprintf("³   ³   ³   º   ³   ³   º   ³   ³   ³\n");
 gotoxy(3,21);cprintf("ÀÄÄÄÁÄÄÄÁÄÄÄÐÄÄÄÁÄÄÄÁÄÄÄÐÄÄÄÁÄÄÄÁÄÄÄÙ\n");
 textbackground(18);
 textcolor(BLACK);
 textattr(3);
 gotoxy(49,5);cprintf(" 0:");
 textbackground(0);
 textcolor(15);
 gotoxy(52,5);cprintf("EFFACER UN NOMBRE     ");

}

//////////////////////////////////////////////////////////

int aff_message_activation_de_l_aide_au_debut(void)
{

 int w,b,d,active_aide;
 textbackground(0);

 //POUR METTRE OMBRE VOISINAGE DU MESSAGE QUI APPARAIT

 textbackground(BLACK);
 gotoxy(32,10);cprintf("                               ");
 gotoxy(32,11);cprintf("                               ");
 gotoxy(32,12);cprintf("                               ");
 gotoxy(32,13);cprintf("                               ");
 gotoxy(32,14);cprintf("                               ");
 textbackground(0);
 textbackground(CYAN);
 textcolor(BROWN);
 gotoxy(30,9);cprintf("ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿");
 gotoxy(30,10);cprintf("³ Voulez-vous activez l'aide? ³");
 gotoxy(30,11);cprintf("³                             ³");
 gotoxy(30,12);cprintf("³  Oui              Non       ³");
 gotoxy(30,13);cprintf("ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ");
 w=33;// sont des coordonne‚ initialiser
 b=12;
 textbackground(WHITE);gotoxy(w,b);cprintf("Oui");
 gotoxy(33,12);
 textbackground(0);
  do
   {
	 d=getch();
	 if(d==0x4B || d==0x4D )// deplacement du curseur
		{     fflush(stdin);
		switch(d)
				 {
				 case GAUCHE :{
							   if(w==33)
									  {
								   gotoxy(w,b);textbackground(WHITE);
								   cprintf("Oui");
								   textbackground(0);
								   gotoxy(50,12);
								   textbackground(CYAN);
								   cprintf("Non");
								   textbackground(0);
								   gotoxy(w,b);break;
									 }
							  else
								   {
									 w=w-17;gotoxy(w,b);
									 textbackground(WHITE);
									 cprintf("Oui");
									 textbackground(0);
									 gotoxy(50,12);
									 textbackground(CYAN);
									 cprintf("Non");
									 textbackground(0);
									 gotoxy(w,b);break;
								  }
							 }// end gauche
			  case DROITE :{
							   if(w==50)
									  {
									gotoxy(w,b);textbackground(WHITE);cprintf("Non");
									textbackground(0);
									gotoxy(33,12);
									textbackground(CYAN);
									cprintf("Oui");
									textbackground(0);
									gotoxy(w,b);break;
									   }
							   else {
									w=w+17;gotoxy(w,b);textbackground(WHITE);
									cprintf("Non");
									textbackground(0);
									gotoxy(33,12);
									textbackground(CYAN);
									cprintf("Oui");
									textbackground(0);
									gotoxy(w,b);break;

								  }
							}// end case droite

		}
	 }
		if(d==13 && w==33)
		  {
			active_aide=1;
		  }

		if(d==13 && w==50)
		   {
			 active_aide=0;
		   }

  }while(d!=13);
return active_aide;
}

////////////////////////////////////////////////////////////////////////////////////

dep deplacement_curseur(int c,dep p)
{

				 switch(c)
								  {
									case HAUT  :  p.yi=p.yi-2;
												   if((p.yi<21)&&(p.yi>=4))
													 {
														gotoxy(p.xi,p.yi);

														 break;
													   }
													 else
													   {
														 p.yi=20;
														 gotoxy(p.xi,p.yi);

														 break;
													   }

									 case BAS :
													p.yi=p.yi+2;
												 if((p.yi<21)&&(p.yi>=4))
														{
															gotoxy(p.xi,p.yi);

															 break;
														}
												  else
														 {

														  p.yi=4;
														  gotoxy(p.xi,p.yi);

														   break;
														   }
									 case GAUCHE :   p.xi=p.xi-4;
													if((p.xi<37)&&(p.xi>=5))
													 {
														gotoxy(p.xi,p.yi);

														break;
													  }
													 else
													  {
														 p.xi=37;
														 gotoxy(p.xi,p.yi);

														  break;
													   }

									case DROITE:
													 if((p.xi<37)&&(p.xi>=5))
													   {
															p.xi=p.xi+4;
															gotoxy(p.xi,p.yi);

															break;
														}
													 else
														{
														  p.xi=5;
														  gotoxy(p.xi,p.yi);

														   break;
														}
							  }// end switch()

	return p;
}

////////////////////////////////////////////////////////////////////////////
int quitte_le_jeux(int x,int y,int couleur)
{
 int w,b,d,g;

   textbackground(BLACK);

				 gotoxy(32,10);cprintf("                               ");
				 gotoxy(32,11);cprintf("                               ");
				 gotoxy(32,12);cprintf("                               ");
				 gotoxy(32,13);cprintf("                               ");
				 gotoxy(32,14);cprintf("                               ");
				 textbackground(0);
				 textbackground(CYAN);
				textcolor(BROWN);
				gotoxy(30,9);cprintf("ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿");
				gotoxy(30,10);cprintf("³ Voulez-vous quittez le jeux ³");
				gotoxy(30,11);cprintf("³                             ³");
				gotoxy(30,12);cprintf("³  Oui              Non       ³");
				gotoxy(30,13);cprintf("ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ");
			   w=33;
			   b=12;
			   textbackground(WHITE);gotoxy(w,b);cprintf("Oui");
			   gotoxy(33,12);
			   textbackground(0);

			   do
			   {
					curseur(0);
					fflush(stdin);
					d=getch();
					if(d==0x4B || d==0x4D )// deplacement du curseur
						 {
						   switch(d)
									{
										case GAUCHE :{if(w==33)
															   {
																	gotoxy(w,b);textbackground(WHITE);cprintf("Oui");textbackground(0);gotoxy(50,12);textbackground(CYAN);cprintf("Non");textbackground(0);gotoxy(w,b);break;}
													   else
															   {
																	 w=w-17;gotoxy(w,b);textbackground(WHITE);cprintf("Oui");textbackground(0);textbackground(0);gotoxy(50,12);textbackground(CYAN);cprintf("Non");textbackground(0);gotoxy(w,b);break;}}
										case DROITE :{
													  if(w==50){
																   gotoxy(w,b);textbackground(WHITE);cprintf("Non");textbackground(0);textbackground(0);gotoxy(33,12);textbackground(CYAN);cprintf("Oui");textbackground(0);gotoxy(w,b);break;}

													   else {
																	w=w+17;gotoxy(w,b);textbackground(WHITE);cprintf("Non");textbackground(0);textbackground(0);gotoxy(33,12);textbackground(CYAN);cprintf("Oui");textbackground(0);gotoxy(w,b);break;
															 }
													  }

									}
					  }
					   if(d==13 && w==33)
							{
								g=27;
							}
					   if(d==13 && w==50)
							 {
							  textbackground(BLUE);clrscr();grille(couleur);d=13;g=11;gotoxy(x,y);
							 }
					  curseur(1);
			  }while(d!=13);
 return  g;
}

//////////////////////////////////////////////////////////////////////////////////////
void return_a_la_grille(int x,int y,int couleur){

					initialise(F);

					initialise(t);
					textbackground(BLUE);
					grille(couleur);
					textcolor(15);
					textbackground(12);
					gotoxy(x,y);
					}

//////////////////////////////////////////////////////////////////////////////

void solution(void)
{

int v,p,i,j;

  sudo(t);

   for(v=4;v<21;v=v+2)
	for(p=5;p<=37;p=p+4)
	  {
			  i=indicex(p);
			  j=indicey(v);

			   if(t[j][i]==F[j][i])
					{
					  gotoxy(p,v); textcolor(YELLOW);
					  cprintf("%d",abs(t[j][i]));
					  textcolor(15);
					}
			   else
				   {
					 gotoxy(p,v); textcolor(RED);
					 cprintf("%d",abs(t[j][i]));
				   }
		}// end la deuxieme for
   }

////////////////////////////////////////////////////////////////////////////////

int message_aide_activer(int x,int y)
{

   textbackground(CYAN+BLINK);textattr(4);
   gotoxy(32,1);
   cprintf(" F1: L'AIDE ACTIVER ");
   textbackground(18);
   textcolor(WHITE);
   textattr(3);
   gotoxy(56,1);
   cprintf("F2: L'AIDE DESACTIVER");
   gotoxy(x,y);textbackground(0);

   return 1;
}

///////////////////////////////////////////////////////////////////////////////////////
int message_aide_desactiver(int x,int y)
{
   textbackground(18);textattr(3);
   gotoxy(32,1);
   cprintf(" F1: L'AIDE ACTIVER ");
   textbackground(CYAN+BLINK);
   textattr(4);
   gotoxy(56,1);
   cprintf("F2: L'AIDE DESACTIVER");
   gotoxy(x,y);
   textbackground(0);

return 0;
}
/////////////////////////////////////
int changer_couleur_de_la_grille(void)

{
int n,h;

do
{
 clrscr();
 textbackground(RED);
 gotoxy(20,2);cprintf(" CHANGER LA COULEUR DE LA GRILLE ");
 gotoxy(20,4);cprintf(" 0: BLACK ");
 gotoxy(20,5);cprintf(" 1: BLUE ");
 gotoxy(20,6);cprintf(" 2:GREEN ");
 gotoxy(20,7);cprintf(" 3:CYAN ");

 gotoxy(20,8);cprintf(" 5:MAGANTA");
 gotoxy(20,9);cprintf(" 6:BROWN ");
 gotoxy(21,11); cprintf(" CHOISIR UN NUMERO DE VOTRE CHOIX:: ");

 n=getch();
   if(isdigit(n))
	 {scanf("%d",&n);}

}
while((n<0)||(n>6));

return n;
}

///////////////////////////////////////////////////////////////////////////
void help_sudoku(void)

{
textbackground(RED);
 curseur(0);
gotoxy(10,4); cprintf("ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿");
	gotoxy(10,5); cprintf("³                    PRINCIPE DU JEUX                            ³");
	gotoxy(10,6); cprintf("³ UTILISEZ LES FLECHE DE VOTRE CLAVIER                           ³");
	gotoxy(10,7); cprintf("³ POUR VOUS DEPLACEZ DANS LA GRILLE                              ³");
	gotoxy(10,8); cprintf("³ SI VOUS VOULEZ ACTIVE L'AIDE APPUYER                           ³");
	gotoxy(10,9); cprintf("³ SUR  F1                                                        ³");
	gotoxy(10,10);cprintf("³ POUR DESACTIVER APPUYER SUR F2                                 ³");
	gotoxy(10,11);cprintf("³ SOLUTION APPUYER SUR F3                                        ³");
	gotoxy(10,12);cprintf("³ CHANGER LA COULEUR DE LA GRILLE F4                             ³");
	gotoxy(10,13);cprintf("³                                                                ³");
	gotoxy(10,14);cprintf("ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ");
}

//////////////////////////////////////////////////////////////////////////////

void creation(void)
{
   int gdriver = DETECT, gmode, errorcode;

   initgraph(&gdriver, &gmode, "");
   setcolor(14);
   settextstyle(2,0,7);
   outtextxy(200,150,"AHABRI MONSSIF");
   setfillstyle(2,1);
   bar(50,100,150,200);
   getch();
   closegraph();

}

/////////////////////////////////////////////////////////////////////////////////////
void titre_sudoku()
{
int i;
textbackground(BLUE);
gotoxy(1,24);printf("                        SU DO KU .... ");
for(i=0;i<5;i++)
{    textcolor(i+1);
  gotoxy(25,24);cprintf("S");
	 textcolor(i+2);
  gotoxy(26,24);cprintf("U");
	 textcolor(i+3);
  gotoxy(28,24);cprintf("D");
	  textcolor(i+4);
  gotoxy(29,24);cprintf("O");
	  textcolor(i+5);
  gotoxy(31,24);cprintf("K");
	  textcolor(i+6);
  gotoxy(32,24);cprintf("U");
   textcolor(i+7);
  gotoxy(34,24);cprintf(".");
  textcolor(i+8);
  gotoxy(35,24);cprintf(".");
	 textcolor(i+9);
  gotoxy(36,24);cprintf(".");

  delay(700);
}
  getch();

}
/////////////////////////////////////////////////////////////////////////////
void inter()
{
int gdriver = DETECT,gmode;
initgraph(&gdriver, &gmode,"");
setcolor(CYAN);
setbkcolor(BLUE);
settextstyle(1,HORIZ_DIR,6);
outtextxy(30,200,"PROJET JEUX SUDOKU");
settextstyle(1,HORIZ_DIR,2);
outtextxy(30,350,"REALISE PAR AHABRI MONSSIF");
getch();
closegraph();
}
//////////////////////////////////////////////////////////////////////////////////
void retour_a_la_case_precedente( int t[9][9],int *i , int *j)
{

 if(( (*j)==0 ) && ( (*i) > 0 ) )
	 {
	   (*j)=8; (*i)--; }

 if(( (*j)> 0 ) && ( (*i)>= 0 ) )
	{  (*j)--; }

  for((*i) ; (*i) >= 0 ;(*i)--)
	  {
		  while( (*j)>=0 )
						{
						 if( ( t[*i][*j]<0 ) )

						  { return;}

						  else

						  (*j)--;
						  }
		 if((*j)<0 && (*i) > 0  ) (*j)=8;
	  }

 if((*i)<0 && (*j)  >=0)

	   (*i)=0;

 if((*i)<0 && (*j)<0)
			{
			   gotoxy(30,25);
			   cprintf("GRILLE NA PAS DE SOLUTION...");
			   getch();
			   exit(0);

			}

}

//************************************************************
void  back(int t[9][9],int *i , int *j )
{

int element,incrementation ;

   t[*i][*j]=0 ;

   retour_a_la_case_precedente(t,i,j);

	   if (t[*i][*j] > -9 )
		  {
			incrementation = 1  ;

		   do{

			   element= t[*i][*j]-incrementation;
			   incrementation++;

		   if(!colonnes(t,*i,*j,-element)&&!ligne(t,*i,*j,-element)&&!verifie(t,-element,*i,*j))
				 {
				  t[*i][*j] = element;
				  return;
				  }
		   }while(element > -9);

		   if( element <= -9)
			   back(t,i,j);

	   }
	   else if (t[*i][*j] == (-9) )
			{
			   back(t,i,j);
			 }

}

//***********************************************************************************

void sudo(int t[9][9])

{

int  i ,j;
int element ;

	 for(i=0;i<9;i++)
	   for(j=0;j<9;j++)
		 if(!t[i][j])
						 {

							 for(element=1 ; element<=9 ; element++)

											  {
												if(!colonnes(t,i,j,element) && !ligne(t,i,j,element) && !verifie(t,element,i,j) )
												  {
													t[i][j] = -element ;
													break;
												   }
												}

						   if(element>9)
							  {
								back(t,&i,&j);

							   }

						}

}
////////////////////////////////////////////////////////////////////////////

Calculatrice faite en 2008 en vb6 (Nostalgie)

Posted: 27th juillet 2011 by ahabrimonssif in Microsoft
Tags:




patterns & practices: Prism

Posted: 26th juillet 2011 by ahabrimonssif in C#, Silverlght

patterns & practices: Prism

Prism fournit des conseils pour vous aider plus facilement concevoir et construire riche, flexible et facile à entretenir, Windows Presentation Foundation applications de bureau (WPF), les applications Silverlight Internet riches (RIA), et Windows Mobile 7 applications. En utilisant des modèles de conception qui incarnent les principes importants de conception architecturale, tels que la séparation des préoccupations et le couplage lâche, Prism vous permet de concevoir et de construire des applications utilisant des composants faiblement couplés qui peuvent évoluer de manière indépendante mais qui peuvent être facilement et parfaitement intégrés dans l’application globale. Ces types d’applications sont connus comme des applications composites.

Prism comprend des implémentations de référence, QuickStarts, code de la bibliothèque réutilisable (la Bibliothèque Prism), et une documentation détaillée. Cette version de Prism cibles de Microsoft. NET Framework 4.0 et Silverlight 4 et inclut de nouvelles directives dans le Modèle-Vue-ViewModel (MVVM) modèle, la navigation, et le Managed Extensibility Framework (MEF). Parce que Prism est construit sur la 4.0. NET Framework (qui comprend WPF) et Silverlight 4, la familiarité avec ces technologies est utile pour évaluer et adopter Prism.

Application Iphone de mon Blog WordPress

Posted: 14th juin 2011 by ahabrimonssif in Iphone
Tags: , , , ,



Créer un lecteur Mp3 et Wav en WPF et C#

Posted: 14th juin 2011 by ahabrimonssif in C#
Tags: , , ,

Lecteur MP3 programme .net C#

using System;
using System.IO;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using Microsoft.DirectX.AudioVideoPlayback;
using System.Windows.Forms;
using System.Windows.Input;

namespace LecteurMP3
{
	public partial class Window1
    {
        Audio lec;
        Boolean lecture = false;
		public Window1()
		{
			this.InitializeComponent();

			// Insérez le code requis pour la création d'objet sous ce point.
		}

        private void BTM_Click(object sender, RoutedEventArgs e)
        {

        }

        private void btm_Click_1(object sender, RoutedEventArgs e)
        {
            Stream myStream = null;
            if (lecture == false)
            {
                OpenFileDialog x = new OpenFileDialog();
                x.Filter = "Fichier audio |*.mp3;*.wav";
                x.Title = "Ovrire des ficher musical";
                if (x.ShowDialog().ToString() == "OK")
                {

                    if ((myStream = x.OpenFile()) != null)
                    {

                        using (myStream)
                        {
                            lec = new Audio(x.FileName.ToString());
                            lec.Play();

                            lecture = true;
                            lbl1.Content = x.SafeFileName.ToString();
                        }
                    }
                }
            }
            else
            { lec.Play(); }

        }

        private void BTM_STOP_Click(object sender, RoutedEventArgs e)
        {
            if (lecture == true)
            {
                lec.Stop();
                lec.Dispose();
                lecture = false;
                lbl1.Content = "";
            }
        }

        private void BTM_PAUSE_Click(object sender, RoutedEventArgs e)
        {if(lecture==true)
            lec.Pause();
        }

        private void BTM_FERMER_Click(object sender, RoutedEventArgs e)
        {

            Close();
        }
        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
        {
            base.OnMouseLeftButtonDown(e);

            this.DragMove();
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {

        }
	}
}

Explication :

private void btm_Click_1(object sender, RoutedEventArgs e)
        {
            Stream myStream = null;
            if (lecture == false)
            {
                OpenFileDialog x = new OpenFileDialog();
                x.Filter = "Fichier audio |*.mp3;*.wav";
                x.Title = "Ovrire des ficher musical";
                if (x.ShowDialog().ToString() == "OK")
                {

                    if ((myStream = x.OpenFile()) != null)
                    {

                        using (myStream)
                        {
                            lec = new Audio(x.FileName.ToString());
                            lec.Play();

                            lecture = true;
                            lbl1.Content = x.SafeFileName.ToString();
                        }
                    }
                }
            }
            else
            { lec.Play(); }

        }

quand on clique sur le bouton Play , premièrement OpenFileDialog s ‘ouvre pour choisir nos Mp3 ou bien Wav après on clique sur ok ensuite OpenFileDialog se ferme est la chanson est lancé .

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Net.Mail;
using System.Windows.Forms.VisualStyles;
using System.Runtime.Serialization.Formatters.Binary;

namespace MyGmail
{
    public partial class Form1 : Form
    {
        int att_counter = 0;
        bool bold = true, italic = false, underlined = false;
        String name="";
        String pa="";

        MailMessage myMail = new MailMessage();
        MailAddress mailSender;

        String attPath = "";

        String colorName = "Black"; //default color

        DrawingPanel dp;
        HTMLViewer htmlV;

        public Form1()
        {
            InitializeComponent();

            ContextMenu menu = new ContextMenu();
            MenuItem remove = new MenuItem("Remove");
            remove.Click += new EventHandler(remove_Click);
            menu.MenuItems.Add(remove);
            att_lstbx.ContextMenu = menu;
        }

        void remove_Click(object sender, EventArgs e)
        {
            Attachment at = new Attachment(att_lstbx.SelectedItem.ToString());
            myMail.Attachments.Remove(at);
            att_lstbx.Items.Remove(att_lstbx.SelectedItem);
            att_counter--;
            label7.Text = "(" + att_counter + ")";
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            DirectoryInfo dinf = new DirectoryInfo("C:\\myGmail");
            FileInfo finf = new FileInfo("C:\\myGmail\\user.mail");
            if (finf.Exists)
            {
                TextReader tr = new StreamReader("C:\\myGmail\\user.mail");
                name = tr.ReadLine();
                pa = RealPW(tr.ReadLine());
               // chkbx_remember.Checked = true;
                tr.Close();
            }
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            FileInfo finf = new FileInfo("C:\\myGmail\\user.mail");
            if (finf.Exists)
            {
                Stream stream = File.Open("C:\\myGmail\\user.mail", FileMode.Create, FileAccess.ReadWrite);
                TextWriter tw = new StreamWriter(stream);

                    tw.WriteLine(name);
                    tw.WriteLine(FakePW(pa));
                    tw.Close();

            }
        }

        private void btn_send_Click(object sender, EventArgs e)
        {int j=0;
        int hh =int.Parse(txt_nombre.Text.ToString());
        while (j < hh)
        {
            String name = "login";// login du gmail
            String pa = "motdepasse";// password
             mailSender = new MailAddress(name+"@gmail.com");

            myMail.To.Add(to_txt.Text);
            myMail.From = mailSender;

            myMail.Subject = subj_txt.Text;

            string body = rchtxtbx_body.Text;
            if (bold)
                body = "<b>" + body + "</b>";
            if (italic)
                body = "<i>" + body + "</i>";
            if (underlined)
                body = "<u>" + body + "</u>";

            myMail.Body = body;
            myMail.IsBodyHtml = true;
            SmtpClient sc = new SmtpClient("smtp.gmail.com", 465);
            sc.Credentials = new System.Net.NetworkCredential(mailSender.ToString(),pa);
            sc.EnableSsl = true;
            try
            {
                sc.Send(myMail);
            }
            catch (Exception)
            {
              MessageBox.Show("Error !\nmake sure that you typed the correct password & username.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
           // MessageBox.Show("Message Sent");

            j++;
        }
        MessageBox.Show("OK c bon");
            }

        private void label9_Click(object sender, EventArgs e)
        {
            if (bold)
            {
                label9.BackColor = Color.FromKnownColor(KnownColor.Control);
                bold = false;
            }
            else
            {
                label9.BackColor = Color.White;
                bold = true;
            }
            AdjustFont(bold, italic, underlined);
        }
        private void label10_Click(object sender, EventArgs e)
        {
            if (italic)
            {
                label10.BackColor = Color.FromKnownColor(KnownColor.Control);
                italic = false;
            }
            else
            {
                label10.BackColor = Color.White;
                italic = true;
            }
            AdjustFont(bold, italic, underlined);
        }
        private void label11_Click(object sender, EventArgs e)
        {
            if (underlined)
            {
                label11.BackColor = Color.FromKnownColor(KnownColor.Control);
                underlined = false;
            }
            else
            {
                label11.BackColor = Color.White;
                underlined = true;
            }
            AdjustFont(bold, italic, underlined);
        }
        private void AdjustFont(bool bold_, bool italic_, bool underlined_)
        {
            if (bold && !italic && !underlined)
            {
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font, FontStyle.Regular);
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font, FontStyle.Bold);
            }
            else if (!bold && italic && !underlined)
            {
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font, FontStyle.Regular);
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font, FontStyle.Italic);
            }
            else if (!bold && !italic && underlined)
            {
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font, FontStyle.Regular);
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font, FontStyle.Underline);
            }
            else if (bold && italic && !underlined)
            {
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font, FontStyle.Regular);
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font, FontStyle.Bold | FontStyle.Italic);
            }
            else if (bold && !italic && underlined)
            {
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font, FontStyle.Regular);
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font, FontStyle.Bold | FontStyle.Underline);
            }
            else if (!bold && italic && underlined)
            {
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font, FontStyle.Regular);
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font, FontStyle.Underline | FontStyle.Italic);
            }
            if (!bold && !italic && !underlined)
            {
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font, FontStyle.Regular);
            }
            else if (bold && italic && underlined)
            {
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font, FontStyle.Underline | FontStyle.Italic | FontStyle.Bold);
            }
        }
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBox1.SelectedItem.ToString() == "Large")
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font.FontFamily, 20f, rchtxtbx_body.Font.Style);
            else if (comboBox1.SelectedItem.ToString() == "Medium")
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font.FontFamily, 15f, rchtxtbx_body.Font.Style);
            else if (comboBox1.SelectedItem.ToString() == "Small")
                rchtxtbx_body.Font = new Font(rchtxtbx_body.Font.FontFamily, 10f, rchtxtbx_body.Font.Style);
        }

        private void label6_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.ShowDialog();
            if (ofd.FileName != "")
            {
                Attachment at = new Attachment(ofd.FileName);
                myMail.Attachments.Add(at);
                att_counter++;
                label7.Text = "(" + att_counter + ")";
                att_lstbx.Items.Add(ofd.FileName);
            }

        }

        private string FakePW(string password)
        {
            string new_password = "";
            int l = password.Length;
            for (int i = l-1; i >=0; i--)
            {
                new_password += password[i];
            }
            return new_password;
        }

        private string RealPW(string password)
        {
            string real_password = "";
            int l = password.Length;
            for (int i = l - 1; i >= 0; i--)
            {
                real_password += password[i];
            }
            return real_password;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            dp = new DrawingPanel();
            dp.FormClosing += new FormClosingEventHandler(dp_FormClosing);
            dp.ShowDialog();
        }

        void dp_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (dp.IsAtt)
            {
                Attachment at = new Attachment(dp.Attpath);
                myMail.Attachments.Add(at);
                att_counter++;
                label7.Text = "(" + att_counter + ")";
                att_lstbx.Items.Add(dp.Attpath);
            }

        }

        void dp_FormClosed(object sender, FormClosedEventArgs e)
        {
            Attachment at = new Attachment(attPath);
            myMail.Attachments.Add(at);
            att_counter++;
            label7.Text = "(" + att_counter + ")";
            att_lstbx.Items.Add(attPath);

        }

        private void label12_Click(object sender, EventArgs e)
        {
            ColorDialog cd = new ColorDialog();
            cd.ShowDialog();
            rchtxtbx_body.ForeColor = cd.Color;
            colorName = cd.Color.Name;
        }

        private void label13_Click(object sender, EventArgs e)
        {
            try
            {
                string body = rchtxtbx_body.Text;
                if (bold)
                    body = "<b>" + body + "</b>";
                if (italic)
                    body = "<i>" + body + "</i>";
                if (underlined)
                    body = "<u>" + body + "</u>";
                if (comboBox1.SelectedItem.ToString() == "Large")
                    body = "<font color=\"" + colorName + "\"size=\"5\">" + body + "</font>";
                else if (comboBox1.SelectedItem.ToString() == "Medium")
                    body = "<font color=\"" + colorName + "\"size=\"3\">" + body + "</font>";
                else if (comboBox1.SelectedItem.ToString() == "Small")
                    body = "<font color=\"" + colorName + "\"size=\"1\">" + body + "</font>";
                htmlV = new HTMLViewer(body);
                htmlV.ShowDialog();
            }
            catch (Exception)
            {
            }
        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }

    }
}

HTML5 + JAVASCRIPT: CRÉER UN DOOM LIKE !

Posted: 12th juin 2011 by ahabrimonssif in JEUX
Tags:


Ben Joffe à créé un Doom like ultra fluide et au chargement instantané, en utilisant Javascript et HTML5 Canvas !

Le résultat est bluffant quand on pense qu’il n’y'a pas une seule touche de Flash ou silverlight …

Vous devez utiliser Firefox, Opera ou Safari pour voir l’exemple ci-dessous, IE ne supporte pas l’élément Canvas

ADRESSE DU JEUX