⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit1.~pas

📁 cvery_608119760.rar
💻 ~PAS
字号:
unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls,nb30;
type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    edtMACAddress: TEdit;
    GroupBox2: TGroupBox;
    btnRun: TButton;
    btnExit: TButton;
    procedure btnRunClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.btnRunClick(Sender: TObject);
Var
  NCB : TNCB;
  ADAPTER : TADAPTERSTATUS;
  LANAENUM : TLANAENUM;
  intIdx : Integer;
  result : Char;
  buf : String;
begin
  Try
    ZeroMemory(@NCB, SizeOf(NCB));
    NCB.ncb_command := Chr(NCBRESET);
    NCB.ncb_lana_num := LANAENUM.lana[0];
    result := NetBios(@NCB);
    If Ord(result)<>0 Then
      exit;
    //获取网卡适配器地址
    ZeroMemory(@NCB, SizeOf(NCB));
    NCB.ncb_command := Chr(NCBASTAT);
    NCB.ncb_lana_num := LANAENUM.lana[0];
    StrPCopy(NCB.ncb_callname, '*');
    NCB.ncb_buffer := @ADAPTER;
    NCB.ncb_length := SizeOf(ADAPTER);
    result := NetBios(@NCB);
    If Ord(result)<>0 Then
      exit;
    buf := '';
    For intIdx := 0 To 5 Do
      buf := buf + InttoHex(Integer(ADAPTER.adapter_address[intIdx]),2)+'-';
    edtMACAddress.Text := copy(buf,0,length(buf)-1);
  Finally
  End;

end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -