begin process at 2010 02 10 01:14:07
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Base de Donnees

 > GERER DES CDS

GERER DES CDS


 Information sur la source

Note :
Aucune note
Catégorie :Base de Donnees Niveau :Débutant Date de création :04/07/2003 Date de mise à jour :05/07/2003 12:19:29 Vu / téléchargé :3 724 / 13 537

Auteur : kanigou

Ecrire un message privé
Commentaire sur cette source (2)
Ajouter un commentaire et/ou une note

 Description

Cliquez pour voir la capture en taille normale
Bon, c'est un programme simple permetant de gerer des CDs. J'ai au debut voulu le faire pour moi pour gerer mes DivXs, mais finalement je le met sur ce site pour gerer des CDs. Il ya  que quelques fonctions, et j'aimerai un peu le perfectionner, mais pour l'instant ces fonctions me suffisent . Peut etre que le code n'est pas super, mais ca fonctionne . Je voudrais juste regler un probleme, c'est quand on enleevv un CD ou on l'ajoute et que si il y a rien il marque un message d'erreur ...  
Et sinon, je ne sais pas ou se place le fichier cds.ini, je ne le vois pas ....

Source

  • unit Unit1;
  • interface
  • uses
  • Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  • Dialogs, StdCtrls, IniFiles;
  • type
  • TForm1 = class(TForm)
  • ComboBox1: TComboBox;
  • Button1: TButton;
  • Edit1: TEdit;
  • Button2: TButton;
  • Memo1: TMemo;
  • Button3: TButton;
  • Button4: TButton;
  • Label1: TLabel;
  • procedure Button4Click(Sender: TObject);
  • procedure FormCreate(Sender: TObject);
  • procedure Button1Click(Sender: TObject);
  • procedure Button2Click(Sender: TObject);
  • procedure Choisir(Sender: TObject);
  • procedure Button3Click(Sender: TObject);
  • private
  • { Private declarations }
  • public
  • { Public declarations }
  • end;
  • var
  • Form1: TForm1;
  • x,s,d,l,a,f,q,o : String;
  • Ini : TIniFile;
  • Procedure TrierUnTStrings(Liste:TStrings);
  • implementation
  • {$R *.dfm}
  • procedure TForm1.Button4Click(Sender: TObject);
  • begin
  • ComboBox1.Items.SaveToFile('divxs.txt');
  • Form1.Close;
  • end;
  • procedure TForm1.FormCreate(Sender: TObject);
  • begin
  • If FileExists('divxs.txt') then
  • begin
  • ComboBox1.Items.LoadFromFile('divxs.txt');
  • Memo1.Clear;
  • Label1.Caption := IntToStr(ComboBox1.Items.Count)+' CD(s)';
  • end
  • else
  • MessageBox(Form1.Handle,'Ce fichier crééra 2 nouveaux fichiers necessaire pour le fonctionnement du programme. Veuillez ne pas les supprimés. SI vous changer de place le programme, il est necessaire de mettre les 2 fichiers avec le programme.','Attention : premiere utilisation',64);
  • Memo1.Clear;
  • Label1.Caption := IntToStr(ComboBox1.Items.Count)+' CD(s)';
  • TrierUnTStrings(ComboBox1.Items);
  • end;
  • procedure TForm1.Button1Click(Sender: TObject);
  • begin
  • x := Edit1.text;
  • If x <> '' then
  • ComboBox1.Items.Add(x);
  • Ini := TIniFile.Create('divxs.ini');
  • Ini.WriteString(x,'nom',''+x+'');
  • Ini.WriteString(x,'preter','Preté : Non');
  • Ini.WriteString(x,'qui','à :');
  • Ini.WriteString(x,'quand','le :');
  • Ini.free;
  • Label1.Caption := IntToStr(ComboBox1.Items.Count)+' CD(s)';
  • Edit1.Text := '';
  • ComboBox1.Text := '';
  • Memo1.Clear;
  • TrierUnTStrings(ComboBox1.Items);
  • end;
  • procedure TForm1.Button2Click(Sender: TObject);
  • begin
  • If ComboBox1.text <> '' then
  • Ini := TIniFIle.Create('divxs.ini');
  • Ini.EraseSection(ComboBox1.Text);
  • Ini.free;
  • ComboBox1.DeleteSelected;
  • Label1.Caption := IntToStr(ComboBox1.Items.Count)+' CD(s)';
  • Edit1.Text := '';
  • ComboBox1.Text := '';
  • Memo1.Clear;
  • TrierUnTStrings(ComboBox1.Items);
  • end;
  • procedure TForm1.Choisir(Sender: TObject);
  • begin
  • memo1.Clear;
  • Ini := TIniFIle.Create('divxs.ini');
  • Memo1.Lines.Add(Ini.ReadString(ComboBox1.Text,'nom',''));
  • Memo1.Lines.Add('');
  • Memo1.lines.add(Ini.Readstring(ComboBox1.Text,'preter',''));
  • Memo1.Lines.Add('');
  • Memo1.lines.add(Ini.ReadString(ComboBox1.Text,'qui',''));
  • Memo1.Lines.Add('');
  • Memo1.lines.add(Ini.Readstring(ComboBox1.Text,'quand',''));
  • Ini.free;
  • end;
  • procedure TForm1.Button3Click(Sender: TObject);
  • begin
  • If ComboBox1.Text <> '' then
  • o := InputBox(o,'Preté ???','');
  • a := InputBox(a,'Preté à:','');
  • l := InputBox(l,'le :','');
  • Ini := TIniFIle.Create('divxs.ini');
  • Ini.WriteString(ComboBox1.Text,'nom',ComboBox1.Text);
  • Ini.Writestring(ComboBox1.Text,'preter','Preté : '+o+'');
  • Ini.WriteString(ComboBox1.Text,'qui','à : '+a+'');
  • Ini.WriteString(ComboBox1.Text,'quand','le : '+l+'');
  • Ini.free;
  • end;
  • // Procedure pas de moi - piqué a Nono du Moulin sur le forum de Delphifr.com
  • Procedure TrierUnTStrings(Liste:TStrings);
  • Var i,j:Integer;
  • z :String;
  • Begin
  • For i:=0 To Liste.Count-2 Do For j:=i+1 To Liste.Count-1 Do If Liste[i]>Liste[j]
  • Then Begin
  • z:=Liste[i];
  • Liste[i]:=Liste[j];
  • Liste[j]:=z;
  • End;
  • End;
  • end.
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IniFiles;

type
  TForm1 = class(TForm)
    ComboBox1: TComboBox;
    Button1: TButton;
    Edit1: TEdit;
    Button2: TButton;
    Memo1: TMemo;
    Button3: TButton;
    Button4: TButton;
    Label1: TLabel;
    procedure Button4Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Choisir(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  x,s,d,l,a,f,q,o : String;
  Ini : TIniFile;
  Procedure TrierUnTStrings(Liste:TStrings);

implementation

{$R *.dfm}

procedure TForm1.Button4Click(Sender: TObject);
begin
        ComboBox1.Items.SaveToFile('divxs.txt');
        Form1.Close;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
        If FileExists('divxs.txt') then
        begin
        ComboBox1.Items.LoadFromFile('divxs.txt');
        Memo1.Clear;
        Label1.Caption := IntToStr(ComboBox1.Items.Count)+' CD(s)';
        end
        else
        MessageBox(Form1.Handle,'Ce fichier crééra 2 nouveaux fichiers necessaire pour le fonctionnement du programme. Veuillez ne pas les supprimés. SI vous changer de place le programme, il est necessaire de mettre les 2 fichiers avec le programme.','Attention : premiere utilisation',64);
        Memo1.Clear;
        Label1.Caption := IntToStr(ComboBox1.Items.Count)+' CD(s)';
        TrierUnTStrings(ComboBox1.Items);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
        x := Edit1.text;
        If x <> '' then
        ComboBox1.Items.Add(x);
        Ini := TIniFile.Create('divxs.ini');
        Ini.WriteString(x,'nom',''+x+'');
        Ini.WriteString(x,'preter','Preté : Non');
        Ini.WriteString(x,'qui','à :');
        Ini.WriteString(x,'quand','le :');
        Ini.free;
        Label1.Caption := IntToStr(ComboBox1.Items.Count)+' CD(s)';
        Edit1.Text := '';
        ComboBox1.Text := '';
        Memo1.Clear;
        TrierUnTStrings(ComboBox1.Items);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
        If ComboBox1.text <> '' then
        Ini := TIniFIle.Create('divxs.ini');
        Ini.EraseSection(ComboBox1.Text);
        Ini.free;
        ComboBox1.DeleteSelected;
        Label1.Caption := IntToStr(ComboBox1.Items.Count)+' CD(s)';
        Edit1.Text := '';
        ComboBox1.Text := '';
        Memo1.Clear;
        TrierUnTStrings(ComboBox1.Items);

end;

procedure TForm1.Choisir(Sender: TObject);
begin
        memo1.Clear;
        Ini := TIniFIle.Create('divxs.ini');
        Memo1.Lines.Add(Ini.ReadString(ComboBox1.Text,'nom',''));
        Memo1.Lines.Add('');
        Memo1.lines.add(Ini.Readstring(ComboBox1.Text,'preter',''));
        Memo1.Lines.Add('');
        Memo1.lines.add(Ini.ReadString(ComboBox1.Text,'qui',''));
        Memo1.Lines.Add('');
        Memo1.lines.add(Ini.Readstring(ComboBox1.Text,'quand',''));
        Ini.free;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
        If ComboBox1.Text <> '' then
        o := InputBox(o,'Preté ???','');
        a := InputBox(a,'Preté à:','');
        l := InputBox(l,'le :','');
        Ini := TIniFIle.Create('divxs.ini');
        Ini.WriteString(ComboBox1.Text,'nom',ComboBox1.Text);
        Ini.Writestring(ComboBox1.Text,'preter','Preté : '+o+'');
        Ini.WriteString(ComboBox1.Text,'qui','à : '+a+'');
        Ini.WriteString(ComboBox1.Text,'quand','le : '+l+'');
        Ini.free;

end;


// Procedure pas de moi - piqué a Nono du Moulin sur le forum de Delphifr.com
Procedure TrierUnTStrings(Liste:TStrings);
Var i,j:Integer;
z :String;
Begin
For i:=0 To Liste.Count-2 Do For j:=i+1 To Liste.Count-1 Do If Liste[i]>Liste[j]
Then Begin
z:=Liste[i];
Liste[i]:=Liste[j];
Liste[j]:=z;
End;
End;



end.   


 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !
  • Project1.~dprTélécharger ce fichier [Réservé aux membres club]231 octets
  • Project1.cfgTélécharger ce fichier [Réservé aux membres club]Voir ce fichier432 octets
  • Project1.dofTélécharger ce fichier [Réservé aux membres club]Voir ce fichier1 667 octets
  • Project1.dprTélécharger ce fichier [Réservé aux membres club]Voir ce fichier229 octets
  • Project1.resTélécharger ce fichier [Réservé aux membres club]876 octets
  • Unit1.~ddpTélécharger ce fichier [Réservé aux membres club]51 octets
  • Unit1.~dfmTélécharger ce fichier [Réservé aux membres club]1 609 octets
  • Unit1.~pasTélécharger ce fichier [Réservé aux membres club]5 956 octets
  • Unit1.dcuTélécharger ce fichier [Réservé aux membres club]9 486 octets
  • Unit1.ddpTélécharger ce fichier [Réservé aux membres club]51 octets
  • Unit1.dfmTélécharger ce fichier [Réservé aux membres club]1 609 octets
  • Unit1.pasTélécharger ce fichier [Réservé aux membres club]Voir ce fichier5 957 octets

Télécharger le zip


 Sources du même auteur

Source avec Zip Source avec une capture SUPPRIMER DES DOSSIERS TEMPORAIRES SOUS WINXP

 Sources de la même categorie

Source avec Zip INTERBASE FIREBIRD IBEXPERT par opgiat
Source avec Zip CREE ALIAS AUTOMATIQUEMENT CREATION REPERTOIRE ET TABLE AUSI par opgiat
Source avec Zip CRÉE UN RÉPERTOIRE ET CRÉE CES TABLES PAR PROGRAMME par opgiat
Source avec Zip Source avec une capture CONNEXION MYSQL ET RECUPERATION DANS BASE ACCESS par eli42
Source avec Zip Source avec une capture LIER DEUX TDBGRID par cantador

Commentaires et avis

Commentaire de fostex le 22/11/2004 18:24:37

bonjour,

Je n'arrive pas à compiler ton projet...

Commentaire de recup1 le 28/04/2007 16:14:11

Ton zip ne contient qu'un fichier RES.
Il faut au moins un fichier DPR, PAS, DFM,... et en plus les fichier RES doivent être supprimmer !

Ce n'est pas grave, mais la prochaine fois fait plus attention !

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,874 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales