PDA

View Full Version : بدست آوردن شماره سریال Bios و کارت شبکه



Future
پنج شنبه 15 دی 1384, 08:26 صبح
سلام دوستان
من می خوام شماره سریال بایوس و کارت شبکه را بدست بیاورم و
لطفا اگه کسی در این زمینه اطلاعاتی داره کمک کنه
با تشکر

Touska
پنج شنبه 15 دی 1384, 09:59 صبح
منظورتون از شماره سریال کارت شبکه همان Mac Address هست یا نه؟

Future
پنج شنبه 15 دی 1384, 12:54 عصر
آره دوست عزیز
منظورم همان Mac Address است

Touska
پنج شنبه 15 دی 1384, 15:09 عصر
از این dll برای بدست آوردن آدرس Mac استفاده کن :

با استفاده از این تابع :


GetMACAddress

و شکل تابع به صورت زیر می باشد :


Function GetMACAddress: ShortString;

Future
شنبه 17 دی 1384, 08:45 صبح
سلام
دوست عزیز من از تابع استفاده کردم وخیلی ممنون
آیا امکانش اسن که من به سورس این dll یا تکه کدی که شماره سریال کارت شبکه را بدست می آورد دسترسی داشته باشم

Touska
شنبه 17 دی 1384, 13:39 عصر
اینم سورسش :


{************************************************* ****************************}
{ Product name : Lock mac for any software }
{ Programmer : Mostafa Sarbazzadeh }
{ Corporation : MSolution.IR }
{ Date : 2003/10/29 }
{ Version : 1.0 }
{************************************************* ****************************}
library Mac;

{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }

uses
SysUtils,
Classes,
NB30,
Dialogs,
Windows;

{$R *.res}

Function GetAdapterInfo(Lana: Char): ShortString;
Var
Adapter: TAdapterStatus;
NCB: TNCB;
Begin
FillChar(NCB, SizeOf(NCB), 0);
NCB.ncb_command := Char(NCBRESET);
NCB.ncb_lana_num := Lana;
IF Netbios(@NCB) <> Char(NRC_GOODRET) Then
Begin
Result := 'Error';
MessageDlg('Error',mtError,[mbok],0);
Exit;
End;

FillChar(NCB, SizeOf(NCB), 0);
NCB.ncb_command := Char(NCBASTAT);
NCB.ncb_lana_num := Lana;
NCB.ncb_callname := '*';

FillChar(Adapter, SizeOf(Adapter), 0);
NCB.ncb_buffer := @Adapter;
NCB.ncb_length := SizeOf(Adapter);
IF Netbios(@NCB) <> Char(NRC_GOODRET) then
Begin
Result := 'Error';
MessageDlg('Error',mtError,[mbok],0);
Exit;
End;
Result :=
IntToHex(Byte(Adapter.adapter_address[0]), 2) + '-' +
IntToHex(Byte(Adapter.adapter_address[1]), 2) + '-' +
IntToHex(Byte(Adapter.adapter_address[2]), 2) + '-' +
IntToHex(Byte(Adapter.adapter_address[3]), 2) + '-' +
IntToHex(Byte(Adapter.adapter_address[4]), 2) + '-' +
IntToHex(Byte(Adapter.adapter_address[5]), 2);
End;

Function GetMACAddress: ShortString;
Var
AdapterList: TLanaEnum;
NCB: TNCB;
Begin
FillChar(NCB, SizeOf(NCB), 0);
NCB.ncb_command := Char(NCBENUM);
NCB.ncb_buffer := @AdapterList;
NCB.ncb_length := SizeOf(AdapterList);
Netbios(@NCB);
IF Byte(AdapterList.length) > 0 then
Result := GetAdapterInfo(AdapterList.lana[0])
Else
Begin
Result := 'Error';
MessageDlg('Error',mtError,[mbok],0);
End;
End;

Exports
GetMACAddress; //Exports Function

begin
end.