|
Trouver une ressource
Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum. Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !
INFORMATIONS DISQUE ET SYSTEME
Information sur la source
Description
Bonjour tt le monde ;-) Ce petit programme nous permet d’obtenir: Le nom du volume du disque ; La longueur maximum des noms des fichiers ; Le numéro de série de disque ; Système de fichiers ; Le système d’exploitation ; La version du système ; Le numéro de service ; Référence du processeur ; toutes questions ou critiques les bienvenues Pour terminer vous souhaite bon courage et bonne programmation.
Source
- unit InformationsDisques;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, ExtCtrls,Registry;
-
- type
- TForm1 = class(TForm)
- BOk: TButton;
- PlRep: TPanel;
- EditChemin: TEdit;
- LabelChemin: TLabel;
- BOpen: TButton;
- Dialog: TOpenDialog;
- PInfo: TPanel;
- LongeurMaxiFi: TLabel;
- LNumSerie: TLabel;
- LSysFiles: TLabel;
- LblMaxi: TLabel;
- LblNumeroSerie: TLabel;
- LblSysteme: TLabel;
- LblVolume: TLabel;
- LNomVolume: TLabel;
- Panel1: TPanel;
- Label3: TLabel;
- LSysExp: TLabel;
- LabelVersionMineur: TLabel;
- Label4: TLabel;
- LabelServicePack: TLabel;
- LblServicePack: TLabel;
- Label1: TLabel;
- Panel2: TPanel;
- LblProcesseur: TLabel;
- LabelProcesseur: TLabel;
- procedure BOkClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure BOpenClick(Sender: TObject);
- private
- { Déclarations privées }
- public
- { Déclarations publiques }
- end;
-
- var
- Form1: TForm1;
- chemin:string;
- implementation
-
- {$R *.dfm}
- { Programme réalisé par HAFTARI Fouad, pour plus d'informations
- n'hésitez pas de me contacter
- haftari@hotmail.com }
-
- procedure TForm1.BOkClick(Sender: TObject);
- var
- Repertoire:PChar;
- NomVolume: array[0..255] of Char;
- NumSerie:DWORD;
- LongeurMaxNomFichier:DWORD;
- TypeCase:DWORD;
- FileSystem: array[0..255] of Char;
- reg:TRegIniFile;
- chemin,s1:string;
- begin
- Chemin:=Copy(EditChemin.Text,1,3); // Affecter à chemin les les trois premières lettres de EditChemin
-
- Repertoire:=PChar(Chemin); // Répertoire:= Pchar(3 lettres (EditChemin))
-
- // Si GetVolumeInformation n'est pa afficher un message d''érreure
- if not GetVolumeInformation(Repertoire,NomVolume,SizeOf(NomVolume),@NumSerie,
- LongeurMaxNomFichier,TypeCase, FileSystem,sizeOf(FileSystem))
- then ShowMessage('Erreur');
-
- // On effecte le Nom de volume est de type string à LNomVolume
- LNomVolume.Caption:=String(NomVolume);
- // On effecte la longeure maximum des fichiers est de type entier à LongeurMaxiFi
- // On effecte le Nom de volume est de type string à LNomVolume
- LongeurMaxiFi.Caption:=IntToStr(LongeurMaxNomFichier)+' Caractères';
- // On effecte le numéro de série est de type entier à LNumSérie
- LNumSerie.Caption:=IntToStr(NumSerie);
- // On effecte le type de systèmes de fichier est de type string à LSysFiles
- LSysFiles.Caption:=String(FileSystem);
-
- // ====== Informations du processeur ==============
- // n'oublie pas d'ajouter Registry aux Uses;
- reg:=TRegIniFile.Create('');
- with reg do begin
- begin
- RootKey:=HKEY_LOCAL_MACHINE;
- chemin:='Hardware\Description\System\Centralprocessor\0';
- s1:=ReadString(chemin,'Identifier','<Information non trouvé>');
- end;
- LabelProcesseur.Caption:=s1;
- end;
- reg.free;
-
-
- {
- informations du système d'éxploitation
- Exemple téléchargé depuis le site
- www.phields.com
- source téléchargé le 29 Novembre 2007
- *** un grand merci aux auteurs du site***
- }
- if (Win32Platform = VER_PLATFORM_WIN32_WINDOWS) then
- begin
- LSysExp.Caption:='Win 32 Windows';
- case Win32MajorVersion of
- 4:
- begin
- case Win32MinorVersion of
- 0:
- begin
- LabelVersionMineur.Caption := 'Win95';
- case Win32Platform of
- 1: case Win32CSDVersion[1] of
- 'A': LabelServicePack.Caption:='';
- 'B','C': LabelServicePack.Caption:='OSR2';
- end;
- end;
- end;
- 10:
- begin
- LabelVersionMineur.Caption := 'Win98';
- case Win32CSDVersion[1] of
- 'A': LabelServicePack.Caption:='Microsoft Windows 98';
- 'B': LabelServicePack.Caption:='SE';
- end;
- end;
- 90: LabelVersionMineur.Caption := 'WinMe';
- end;
- end;
- end;
- end;
- if (Win32Platform = VER_PLATFORM_WIN32_NT) then
- begin
- LSysExp.Caption:='Win 32 NT';
- case Win32MajorVersion of
- 4:
- begin
- case Win32MinorVersion of
- 0: LabelVersionMineur.Caption := 'osWinNT4';
- end;
- end;
- 5:
- begin
- case Win32MinorVersion of
- 0: LabelVersionMineur.Caption := 'Win2000';
- 1: LabelVersionMineur.Caption := 'WinXP';
- 2: LabelVersionMineur.Caption := 'WinServer2003';
- end;
- LabelServicePack.Caption:=Win32CSDVersion;
- end;
- end;
- end;
-
- end;
-
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- Editchemin.text:=GetCurrentDir; // Obtenir le chemin de l'éxécutable et l'écrire dans EditChemin
- end;
-
- procedure TForm1.BOpenClick(Sender: TObject);
- begin
- // Condition si Dialog est exécuté on obtienderons le chemin du fichier choisi
- if Dialog.Execute then EditChemin.Text:=Dialog.FileName;
- end;
-
- end.
unit InformationsDisques;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls,Registry;
type
TForm1 = class(TForm)
BOk: TButton;
PlRep: TPanel;
EditChemin: TEdit;
LabelChemin: TLabel;
BOpen: TButton;
Dialog: TOpenDialog;
PInfo: TPanel;
LongeurMaxiFi: TLabel;
LNumSerie: TLabel;
LSysFiles: TLabel;
LblMaxi: TLabel;
LblNumeroSerie: TLabel;
LblSysteme: TLabel;
LblVolume: TLabel;
LNomVolume: TLabel;
Panel1: TPanel;
Label3: TLabel;
LSysExp: TLabel;
LabelVersionMineur: TLabel;
Label4: TLabel;
LabelServicePack: TLabel;
LblServicePack: TLabel;
Label1: TLabel;
Panel2: TPanel;
LblProcesseur: TLabel;
LabelProcesseur: TLabel;
procedure BOkClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure BOpenClick(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
chemin:string;
implementation
{$R *.dfm}
{ Programme réalisé par HAFTARI Fouad, pour plus d'informations
n'hésitez pas de me contacter
haftari@hotmail.com }
procedure TForm1.BOkClick(Sender: TObject);
var
Repertoire:PChar;
NomVolume: array[0..255] of Char;
NumSerie:DWORD;
LongeurMaxNomFichier:DWORD;
TypeCase:DWORD;
FileSystem: array[0..255] of Char;
reg:TRegIniFile;
chemin,s1:string;
begin
Chemin:=Copy(EditChemin.Text,1,3); // Affecter à chemin les les trois premières lettres de EditChemin
Repertoire:=PChar(Chemin); // Répertoire:= Pchar(3 lettres (EditChemin))
// Si GetVolumeInformation n'est pa afficher un message d''érreure
if not GetVolumeInformation(Repertoire,NomVolume,SizeOf(NomVolume),@NumSerie,
LongeurMaxNomFichier,TypeCase, FileSystem,sizeOf(FileSystem))
then ShowMessage('Erreur');
// On effecte le Nom de volume est de type string à LNomVolume
LNomVolume.Caption:=String(NomVolume);
// On effecte la longeure maximum des fichiers est de type entier à LongeurMaxiFi
// On effecte le Nom de volume est de type string à LNomVolume
LongeurMaxiFi.Caption:=IntToStr(LongeurMaxNomFichier)+' Caractères';
// On effecte le numéro de série est de type entier à LNumSérie
LNumSerie.Caption:=IntToStr(NumSerie);
// On effecte le type de systèmes de fichier est de type string à LSysFiles
LSysFiles.Caption:=String(FileSystem);
// ====== Informations du processeur ==============
// n'oublie pas d'ajouter Registry aux Uses;
reg:=TRegIniFile.Create('');
with reg do begin
begin
RootKey:=HKEY_LOCAL_MACHINE;
chemin:='Hardware\Description\System\Centralprocessor\0';
s1:=ReadString(chemin,'Identifier','<Information non trouvé>');
end;
LabelProcesseur.Caption:=s1;
end;
reg.free;
{
informations du système d'éxploitation
Exemple téléchargé depuis le site
www.phields.com
source téléchargé le 29 Novembre 2007
*** un grand merci aux auteurs du site***
}
if (Win32Platform = VER_PLATFORM_WIN32_WINDOWS) then
begin
LSysExp.Caption:='Win 32 Windows';
case Win32MajorVersion of
4:
begin
case Win32MinorVersion of
0:
begin
LabelVersionMineur.Caption := 'Win95';
case Win32Platform of
1: case Win32CSDVersion[1] of
'A': LabelServicePack.Caption:='';
'B','C': LabelServicePack.Caption:='OSR2';
end;
end;
end;
10:
begin
LabelVersionMineur.Caption := 'Win98';
case Win32CSDVersion[1] of
'A': LabelServicePack.Caption:='Microsoft Windows 98';
'B': LabelServicePack.Caption:='SE';
end;
end;
90: LabelVersionMineur.Caption := 'WinMe';
end;
end;
end;
end;
if (Win32Platform = VER_PLATFORM_WIN32_NT) then
begin
LSysExp.Caption:='Win 32 NT';
case Win32MajorVersion of
4:
begin
case Win32MinorVersion of
0: LabelVersionMineur.Caption := 'osWinNT4';
end;
end;
5:
begin
case Win32MinorVersion of
0: LabelVersionMineur.Caption := 'Win2000';
1: LabelVersionMineur.Caption := 'WinXP';
2: LabelVersionMineur.Caption := 'WinServer2003';
end;
LabelServicePack.Caption:=Win32CSDVersion;
end;
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Editchemin.text:=GetCurrentDir; // Obtenir le chemin de l'éxécutable et l'écrire dans EditChemin
end;
procedure TForm1.BOpenClick(Sender: TObject);
begin
// Condition si Dialog est exécuté on obtienderons le chemin du fichier choisi
if Dialog.Execute then EditChemin.Text:=Dialog.FileName;
end;
end.
Conclusion
Pour conclure : un grand salut à tous ceux qui savent ni lire ni écrire…
Sources du même auteur
Sources de la même categorie
Sources en rapport avec celle ci
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
base de registre [ par msuire ]
J'aimerais lire et ecrire dans la base de registre du disque dur d'un pc(x) depuis ma propre machine; Le disque du second pc étant connecté sur le por
Informations système sous Xp [ par cincap ]
Bonjour à tous,Y a t'il quelqu'un qui connaitrai la commande en Delphi pour faire apparaître la boîte des informations système soit l'équivalent de la
Rechercher des informations utiles dans le registre "regedit" [ par ninie33 ]
bonjour à tous, je suis nouvelle sur ce forum, mais depuis quelques jours que je navigue dessus, j'y trouve des astuces intéressantes. Voilà mon probl
détecter informations sur l'ordinateur [ par Maniaxman ]
Bonjour,Je chercherais à obtenir des informations sur un ordinateur avec Delphi.J'ai trouvé un logiciel qui me donne les infos suivantes :Antivirus :
Form qui ne veut rien entendre [ par cavalier2400 ]
On voulant un mot de passe pour mon application, j'ai les fiches suivantes: Application.Initialize;Application.ShowMainForm:= False; Applicat
je cherche des informations sur les AppBar? [ par lotfi213_b19 ]
bonjour a tous, je cherche des informations sur les AppBar,ou bien Desktop Application Bars,j'ai pas trouvé de grande chose sur google,merci
Charger un executable sans passez par le disque dur [ par niakfu ]
Bonjours,Depuis quelque temps je cherche, mais mon résultat n'arrive pas à aboutir.Je cherche une source ou un tutoriel serais encore mieux, en França
Informations sur les arrays [ par Bacterius ]
Bonjour, juste avant de faire le labyrinthe, je voulais plutôt faire un petit jeu 2D, inspiré du jeu Dogfight (voir RockSolidArcade sur Google pour jo
clé registre INNO SETUP [ par nilwak ]
Bonjour à tous, J'ai créer un setup qui à la fin de l'installation lance un second setup. J'aimerais que ce second setup soit lancer en silence (j'y s
|
Téléchargements
Logiciels à télécharger sur le même thème :
Comparez les prix Nouvelle version

LG KP501
Entre 9€ et 159€
|