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
UNE JOLIE-HORLOGE ET PAS QU'UN PEU !UNE JOLIE-HORLOGE ET PAS QU'UN PEU ! par neodante
Pour les possesseurs d'iPhone, ça y est Bijin Tokei - qui se traduit littéralement en Français par " Jolie Horloge " - est arrivé et GRATUITEMENT s'il vous plaît ! Après la version Tokyo, Hokkaido, night club, racing, Gal, "pour les mademoiselles'", . voi...
Cliquez pour lire la suite de l'article par neodante TECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICESTECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICES par ROMELARD Fabrice
Animé par: Gaetan Bouveret et Julien Chomarat Business Connectivity Services (BCS) est dans SharePoint 2010 la version 2 de Business Data Catalog (BDC dans SharePoint 2007). Il s'agit de la solution permettant de visualiser des données provenan...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE par orion
Comme de nombreux geek, je suis un grand amateur de série TV et je rate régulièrement des épisodes de mes séries préférés. Une solution s'offre à vous avec ce merveilleux site : Tv Gorge - www.tvgorge.com Moteur de recherche à l'appui, vous pouvez ...
Cliquez pour lire la suite de l'article par orion TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Vincent Bellet et Baptiste Giraudier La BI dans SharePoint 2010, Les nouveaux services d'application dans SP2010 et SQL Server Reporting services 2008 R2. La BI dans SharePoint est généralisée pour tous afin de permettre à tous les coll...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
|