Delphi编程之系统OEM DIY
生活随笔
收集整理的這篇文章主要介紹了
Delphi编程之系统OEM DIY
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
具體代碼如下:
//轉(zhuǎn)載請注明出處 unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, ExtCtrls, StdCtrls, ExtDlgs,Registry;typeTForm1 = class(TForm)GroupBox1: TGroupBox;Label1: TLabel;Edit1: TEdit;Label2: TLabel;Edit2: TEdit;Label3: TLabel;Edit3: TEdit;Label4: TLabel;Edit4: TEdit;Button1: TButton;GroupBox2: TGroupBox;Button2: TButton;Button3: TButton;Button4: TButton;Button5: TButton;Button6: TButton;Label6: TLabel;Edit5: TEdit;Label7: TLabel;Edit6: TEdit;OpenPictureDialog1: TOpenPictureDialog;Image1: TImage;Label5: TLabel;procedure Button1Click(Sender: TObject);procedure Button2Click(Sender: TObject);procedure Button3Click(Sender: TObject);procedure Button5Click(Sender: TObject);procedure Button6Click(Sender: TObject);procedure Button4Click(Sender: TObject);private{ Private declarations }public{ Public declarations }end;varForm1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject); begin if (Edit1.Text='') and (Edit2.Text='') and (Edit3.Text='') and (Edit4.Text='') and (Edit5.Text='') then MessageBox(0,'您還沒有填寫相關(guān)信息呢!','提示信息',64) else Edit1.Clear; Edit2.Clear; Edit3.Clear; Edit4.Clear; Edit5.Clear end;procedure TForm1.Button2Click(Sender: TObject); begin if OpenPictureDialog1.Execute then Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName); Edit6.Text:= ExtractFileDir(OpenPictureDialog1.FileName)+'\'+ExtractFileName(OpenPictureDialog1.FileName); end;procedure TForm1.Button3Click(Sender: TObject); begin if Image1.Picture.Bitmap.Empty then MessageBox(0,'您還沒有載入圖片呢!','提示信息',64) else Image1.Picture.Bitmap:=nil; end;procedure TForm1.Button4Click(Sender: TObject); begin MessageBox(0,'作者:過往云霄 QQ:154103651'+#13+#13'操作系統(tǒng):Windows 10簡體中文專業(yè)版64位'+#13+#13'編程工具:Delphi 2010英文架構(gòu)師版','提示信息',64); end;procedure TForm1.Button5Click(Sender: TObject); var Reg:TRegistry; begin Reg:=TRegistry.Create; tryReg.Access:=KEY_WOW64_64KEY or KEY_WRITE;Reg.RootKey:=HKEY_LOCAL_MACHINE;if Reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation',True) thenbeginReg.WriteString('Manufacturer',Edit1.Text);Reg.WriteString('Model',Edit2.Text);Reg.WriteString('SupportHours',Edit3.Text);Reg.WriteString('SupportPhone',Edit4.Text);Reg.WriteString('SupportURL',Edit5.Text);//Reg.WriteString('Logo',ExtractFileName(OpenPictureDialog1.FileName)); 獲得文件名稱Reg.WriteString('Logo',ExtractFileDir(OpenPictureDialog1.FileName)+'\'+ExtractFileName(OpenPictureDialog1.FileName));Reg.CloseKey;end; finally Reg.Free; end; end;procedure TForm1.Button6Click(Sender: TObject); begin Close; end;end.?
轉(zhuǎn)載于:https://www.cnblogs.com/guowangyunxiao/p/5287408.html
總結(jié)
以上是生活随笔為你收集整理的Delphi编程之系统OEM DIY的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: dmesg时间转换工具
- 下一篇: 单值二叉树:如果二叉树每个节点都具有相同