不好意思,为了避免修改字体使得代码结构混乱,就不对代码的大小做修改了,如果哪位感兴趣可以拷贝下来细看
在几种语言中对修改网卡mac地址的dll函数调用代码
Dll下载http://www.playicq.cn/dispdocnew.php?id=35175
set_mac.dll调用函数的说明:
function netcard_Description(i:integer): pchar; // 返回对第i块网卡的描述:
function netcardt_count():integer; // 返回物理网卡的总个数:
function netcardf_count():integer; // 返回逻辑网卡的总个数:
function read_mac(i:integer;ft:boolean): pchar; // 返回第i块网卡的 当前mac (ft=false) 或真实mac (ft=true);
function read_mact(i:integer):pchar; // 返回第i块网卡的真实mac;
function read_macf(i:integer):pchar; // 返回第i块网卡的当前mac;
function write_mac(i:integer;macstr:pchar):integer; // 将第i块网卡的MAC改为给定的MAC_STR值;返回1成功,0失败
function set_real_mac(i:integer):integer; // 恢复第i块网卡的MAC为其真实值;返回1成功,0失败
function reg_inf(REdit: pchar):integer; // 将设置你的注册信息
1、delphi中对dll的调用:
var
Form1: TForm1;
const
dllfile='set_mac.dll';
function netcard_Description(i:integer): pchar; stdcall;external dllfile name 'netcard_Description';
function netcardt_count():integer; stdcall;external dllfile name 'netcardt_count';
function netcardf_count():integer; stdcall;external dllfile name 'netcardf_count';
function read_mac(i:integer;ft:boolean): pchar; stdcall;external dllfile name 'read_mac';
function read_mact(i:integer):pchar; stdcall;external dllfile name 'read_mact';
function read_macf(i:integer):pchar; stdcall;external dllfile name 'read_macf';
function write_mac(i:integer;macstr:pchar):integer; stdcall;external dllfile name 'write_mac';
function set_real_mac(i:integer):integer; stdcall;external dllfile name 'set_real_mac';
function reg_inf(REdit: pchar):integer; stdcall;external dllfile name 'reg_inf';
implementation
\{ *.dfm}
2、
vb.net中对DLL的调用:将Set_mac.dll文件和应用程序放置在同一个目录中
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
.
.
.
#End Region
Declare Function netcard_Description Lib "set_mac.dll" Alias "netcard_Description" (ByVal i As Integer) As String
Declare Function netcardt_count Lib "set_mac.dll" Alias "netcardt_count" () As Integer
Declare Function netcardf_count Lib "set_mac.dll" Alias "netcardf_count" () As Integer
Declare Function read_mac Lib "set_mac.dll" Alias "read_mac" (ByVal i As Integer, ByVal ft As Boolean) As String
Declare Function read_mact Lib "set_mac.dll" Alias "read_mact" (ByVal i As Integer) As String
Declare Function read_macf Lib "set_mac.dll" Alias "read_macf" (ByVal i As Integer) As String
Declare Function write_mac Lib "set_mac.dll" Alias "write_mac" (ByVal i As Integer, ByVal macstr As String) As Integer
Declare Function set_real_mac Lib "set_mac.dll" Alias "set_real_mac" (ByVal i As Integer) As Integer
Declare Function reg_inf Lib "set_mac.dll" Alias "reg_inf" (ByVal redit As String) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
3、c# .net中对DLL的调用:将Set_mac.dll文件和应用程序放置在同一个目录中