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
[WF4] PASSAGE D'ARGUMENTS LITERAL, VISUALBASICVALUE OU LAMBDAVALUE?[WF4] PASSAGE D'ARGUMENTS LITERAL, VISUALBASICVALUE OU LAMBDAVALUE? par JeremyJeanson
Avec la sortie de la RC de Visual Studio 2010, Microsoft a mis un peu les points sur leS i en ce qui concernait le passage d'arguments. Mais nous somme un certain nombre à avoir pris ce changement comme un coup dur. Pour résumer la situation : à la sortie...
Cliquez pour lire la suite de l'article par JeremyJeanson [RIA SERVICES] INCLUDE ET DOMAINDATASOURCE[RIA SERVICES] INCLUDE ET DOMAINDATASOURCE par Audrey
Dans un de mes articles précédents , j'avais parlé des DomainDataSource avec RIA Services dans le cas d'une interface Maître - Détail. Dans le même principe, je vais parler d'une autre manière de mettre en forme ce cas d'interface avec RIA Services. Et po...
Cliquez pour lire la suite de l'article par Audrey ZUNE : VERSION ZUNE SOFTWARE V 4.2 ET LA SOCIALISATIONZUNE : VERSION ZUNE SOFTWARE V 4.2 ET LA SOCIALISATION par ROMELARD Fabrice
Une des nouveautés de la version V 3.0 était l'apparition de l'onglet Social qui ne fonctionnait que si le MarketPlace était activé sur son poste. Cela limitait donc son intérêt, car hors du cadre commercial USA-CANADA, peu de monde trouva...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice PRATIQUE DE SILVERLIGHT PAR ERIC AMBROSIPRATIQUE DE SILVERLIGHT PAR ERIC AMBROSI par MPOWARE
Je viens de finir la lecture du dernier livre d'
Eric Ambrosi
éditions PEARSON
Son livre donne une approche pratique de Silverlight qui sera aussi bien comprise par le développeur que par le designeur.
Tous les aspects du développement RIA sont abor...
Cliquez pour lire la suite de l'article par MPOWARE APPRENDRE à DéVELOPPER POUR LES MOBILES AVEC LA NOUVELLE GéNéRATION .NETAPPRENDRE à DéVELOPPER POUR LES MOBILES AVEC LA NOUVELLE GéNéRATION .NET par odewit
2 déclinaisons de Silverlight et 2 déclinaisons de Mono permettent dorénavant (ou permettront prochainement) de développer des applications .NET mobiles pour les principales plates-formes du marché :
Silverlight pour Symbian, basé sur Silverlight 2...
Cliquez pour lire la suite de l'article par odewit
Forum
RE : DELPHIRE : DELPHI par overtaker
Cliquez pour lire la suite par overtaker
Logiciels
Academy System (10.9.4.0)ACADEMY SYSTEM (10.9.4.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Xilisoft Convertisseur Vidéo Ultimate (5.1.39.0305)XILISOFT CONVERTISSEUR VIDéO ULTIMATE (5.1.39.0305)Xilisoft Convertisseur Vidéo Ultimate est un outil puissant de conversion vidéo, facile à utilise... Cliquez pour télécharger Xilisoft Convertisseur Vidéo Ultimate Xilisoft DVD Ripper Ultimate (5.0.64.0304)XILISOFT DVD RIPPER ULTIMATE (5.0.64.0304)Xilisoft DVD Ripper Ultimate est un logiciel excellent pour copier et convertir DVD vers presque ... Cliquez pour télécharger Xilisoft DVD Ripper Ultimate Rigs of Rods (63.3)RIGS OF RODS (63.3)c'est un jeu de multi-simulation camions,autobus voitures, avions, bateaux, hélicoptère avec défo... Cliquez pour télécharger Rigs of Rods
|