Accueil > > > GERER DES CDS
GERER DES CDS
Information sur la source
Description
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.
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
CSS CONTENT STATE SELECTORS (PERSONNAL DRAFT)CSS CONTENT STATE SELECTORS (PERSONNAL DRAFT) par FREMYCOMPANY
Bonjour à tous, Je viens de publier une proposition comprenant 5 pseudo-classes pour le CSS Working Group ayant trait à l'état de chargement d'un élément (ex: IMG,VIDEO,AUDIO,OBJECT pour l'HTML.). Si le c½ur vous en dit, vous pouvez retrouver cette p...
Cliquez pour lire la suite de l'article par FREMYCOMPANY MBA : POURQUOI FAIRE ET COMMENT LE CHOISIR ?MBA : POURQUOI FAIRE ET COMMENT LE CHOISIR ? par ROMELARD Fabrice
Formation initiale Durant la formation, le découpage classique est le suivant (je donnerai les équivalences Suisse lorsque je les connaîtrais) : Ecole primaire jusqu'au Collège : Formation générale permettant d'obtenir les méthodes...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice Y'A DES ERREURS QUI PEUVENT RENDRE LE DéVELOPPEUR VIOLENTY'A DES ERREURS QUI PEUVENT RENDRE LE DéVELOPPEUR VIOLENT par Aleks
Quand on a ce genre d'erreur sans log :
Et bas on a juste envie de choper le gas de Microsoft qu'a développé ça et lui foutre des baffes de Coboye ! ...
Cliquez pour lire la suite de l'article par Aleks [HYPER-V 3] PRéSENTATION DES COMMANDLETS POWERSHELL[HYPER-V 3] PRéSENTATION DES COMMANDLETS POWERSHELL par Pierrick CATRO-BROUILLET
Avec la sortie prochaine de la Beta Consumer Preview de Windows 8, j'avais envie de revenir sur une des fonctionnalités que j'attends le plus et que, en bon geek que je suis, j'utilise déjà : Hyper-V 3 ainsi son module PowerShell.
Il y a déjà pléthor...
Cliquez pour lire la suite de l'article par Pierrick CATRO-BROUILLET IIS7 - COMPRESSION GZIPIIS7 - COMPRESSION GZIP par cyril
La compression GZIP permet d'améliorer les performances de navigation en compressant ce qu'envoie le serveur à un client. Pour comprendre comment cela fonctionne, regardons ce qu'il se passe au niveau HTTP lorsqu'un client tente d'accéder à une ress...
Cliquez pour lire la suite de l'article par cyril
Logiciels
Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning Academy System (17.1.3.0)ACADEMY SYSTEM (17.1.3.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|