Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
ikylin committed Jun 2, 2013
1 parent 28e2513 commit 8e9f207
Show file tree
Hide file tree
Showing 53 changed files with 1,268 additions and 0 deletions.
Binary file added cdkey/DLL/ComputerId.dll
Binary file not shown.
2 changes: 2 additions & 0 deletions cdkey/DLL/动态库使用说明.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
�˶�̬���ӿ��ṩ����������ΪGetCPUSerialNumber��GetMacAddress���ֱ����ַ���ָ����ʽ�����ػ�����CPU���кź�����Mac��ַ���������������������������÷�����Window��APIһ����
��ѹ�������ṩ��delphi��VB�ĵ���ʾ����
Binary file added cdkey/Delphi调用例子(dll)/ComputerId.dll
Binary file not shown.
38 changes: 38 additions & 0 deletions cdkey/Delphi调用例子(dll)/DelphiExample.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
-$A8
-$B-
-$C+
-$D+
-$E-
-$F-
-$G+
-$H+
-$I+
-$J-
-$K-
-$L+
-$M-
-$N+
-$O+
-$P+
-$Q-
-$R-
-$S-
-$T-
-$U-
-$V+
-$W-
-$X+
-$YD
-$Z1
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-LE"d:\program files\borland\delphi7\Projects\Bpl"
-LN"d:\program files\borland\delphi7\Projects\Bpl"
-w-UNSAFE_TYPE
-w-UNSAFE_CODE
-w-UNSAFE_CAST
13 changes: 13 additions & 0 deletions cdkey/Delphi调用例子(dll)/DelphiExample.dpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
program DelphiExample;

uses
Forms,
Unit1 in 'Unit1.pas' {Form1};

{$R *.res}

begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
Binary file added cdkey/Delphi调用例子(dll)/DelphiExample.exe
Binary file not shown.
Binary file added cdkey/Delphi调用例子(dll)/DelphiExample.res
Binary file not shown.
38 changes: 38 additions & 0 deletions cdkey/Delphi调用例子(dll)/Project1.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
-$A8
-$B-
-$C+
-$D+
-$E-
-$F-
-$G+
-$H+
-$I+
-$J-
-$K-
-$L+
-$M-
-$N+
-$O+
-$P+
-$Q-
-$R-
-$S-
-$T-
-$U-
-$V+
-$W-
-$X+
-$YD
-$Z1
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-LE"d:\program files\borland\delphi7\Projects\Bpl"
-LN"d:\program files\borland\delphi7\Projects\Bpl"
-w-UNSAFE_TYPE
-w-UNSAFE_CODE
-w-UNSAFE_CAST
Binary file added cdkey/Delphi调用例子(dll)/Project1.res
Binary file not shown.
Binary file added cdkey/Delphi调用例子(dll)/Unit1.ddp
Binary file not shown.
79 changes: 79 additions & 0 deletions cdkey/Delphi调用例子(dll)/Unit1.dfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
object Form1: TForm1
Left = 244
Top = 223
BorderStyle = bsDialog
Caption = 'Form1'
ClientHeight = 179
ClientWidth = 510
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnActivate = FormActivate
PixelsPerInch = 96
TextHeight = 13
object Label2: TLabel
Left = 20
Top = 31
Width = 133
Height = 13
Caption = #26426#22120#26631#35782#19968'(CPU'#24207#21015#21495#65289
end
object Label1: TLabel
Left = 12
Top = 71
Width = 146
Height = 13
Caption = #26426#22120#26631#35782#20108'('#32593#21345'MAC'#22320#22336#65289
end
object Label3: TLabel
Left = 48
Top = 96
Width = 417
Height = 13
AutoSize = False
Caption = #27880#65306#20320#21487#22312#21629#20196#31383#21475#37324#29992'ipconfig -all'#26597#21040#32593#21345'MAC'#22320#22336'(Physical Adress)'
Font.Charset = DEFAULT_CHARSET
Font.Color = 8388863
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
end
object Button1: TButton
Left = 75
Top = 120
Width = 145
Height = 25
Caption = #37325#26032#21462'CPU'#24207#21015#21495
TabOrder = 0
OnClick = Button1Click
end
object Edit1: TEdit
Left = 160
Top = 28
Width = 305
Height = 21
TabOrder = 1
end
object Edit2: TEdit
Left = 160
Top = 68
Width = 305
Height = 21
TabOrder = 2
end
object Button2: TButton
Left = 272
Top = 120
Width = 145
Height = 25
Caption = #37325#26032#21462#32593#21345'MAC'#22320#22336
TabOrder = 3
OnClick = Button2Click
end
end
52 changes: 52 additions & 0 deletions cdkey/Delphi调用例子(dll)/Unit1.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Label2: TLabel;
Edit1: TEdit;
Label1: TLabel;
Edit2: TEdit;
Button2: TButton;
Label3: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function GetCPUSerialNumber:pchar;stdcall;external 'ComputerId.dll' name 'GetCPUSerialNumber';
function GetMacAddress:pchar;stdcall;external 'ComputerId.dll' name 'GetMacAddress';
var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Text:=GetCPUSerialNumber;

end;

procedure TForm1.FormActivate(Sender: TObject);
begin
Edit1.Text:=GetCPUSerialNumber;
Edit2.Text:=GetMacAddress;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Edit2.Text:=GetMacAddress;
end;

end.
Binary file added cdkey/VB调用示例(DLL)/ComputerId.dll
Binary file not shown.
95 changes: 95 additions & 0 deletions cdkey/VB调用示例(DLL)/Form1.frm
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 4 'Fixed ToolWindow
Caption = "VB示例"
ClientHeight = 2985
ClientLeft = 5295
ClientTop = 4125
ClientWidth = 7470
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2985
ScaleWidth = 7470
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command2
Caption = "重新取网卡MAC地址"
Height = 495
Left = 3840
TabIndex = 5
Top = 2040
Width = 2175
End
Begin VB.TextBox Text2
Height = 285
Left = 2640
TabIndex = 3
Text = "Text1"
Top = 1200
Width = 3615
End
Begin VB.CommandButton Command1
Caption = "重新取CPU序列号"
Height = 495
Left = 1560
TabIndex = 1
Top = 2040
Width = 1935
End
Begin VB.TextBox Text1
Height = 285
Left = 2640
TabIndex = 0
Text = "Text1"
Top = 600
Width = 3615
End
Begin VB.Label Label3
Caption = "注:你可在命令窗口里用ipconfig -all查到网卡MAC地址(Physical Adress)"
ForeColor = &H000000FF&
Height = 255
Left = 360
TabIndex = 6
Top = 1680
Width = 6855
End
Begin VB.Label Label2
Caption = "机器标识二(网卡MAC地址)"
Height = 255
Left = 240
TabIndex = 4
Top = 1200
Width = 2295
End
Begin VB.Label Label1
Caption = "机器标识一(CPU序列号)"
Height = 255
Left = 480
TabIndex = 2
Top = 600
Width = 2175
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetCPUSerialNumber Lib "ComputerId.dll" () As String
Private Declare Function GetMacAddress Lib "ComputerId.dll" () As String



Private Sub Command1_Click()
Text1.Text = GetCPUSerialNumber
End Sub

Private Sub Command2_Click()
Text2.Text = GetMacAddress
End Sub

Private Sub Form_Activate()
Text1.Text = GetCPUSerialNumber
Text2.Text = GetMacAddress
End Sub

34 changes: 34 additions & 0 deletions cdkey/VB调用示例(DLL)/Project1.vbp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Type=Exe
Form=Form1.frm
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINNT\system32\stdole2.tlb#OLE Automation
IconForm="Form1"
Startup="Form1"
ExeName32="VBExample.exe"
Command32=""
Name="Project1"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="foresee"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1

[MS Transaction Server]
AutoRefresh=1
1 change: 1 addition & 0 deletions cdkey/VB调用示例(DLL)/Project1.vbw
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Form1 = 66, 66, 591, 506, Z, 22, 22, 547, 462, C
Binary file added cdkey/VB调用示例(DLL)/VBExample.exe
Binary file not shown.
Loading

0 comments on commit 8e9f207

Please sign in to comment.