下载本文示例代码
1.在程序中实现用默认的Web浏览器打开URL以及发送电子邮件
uses
shellapi;
….
Procedure TForm1.Label1Click(Sender:Tobject);
begin
shellexecute(handle,"open","", nil,nil,sw_show);
end;
procedure
TForm1.Button1Click(Sender: Tobject);
begin
shellexecute(handle,"open", "mailto:user@host.com", nil, nil,sw_shownormal);
end;
2.得到网络适配器的MAC地址
//uses Windows, SysUtils, NB30, 以下为类型定义及函数代码
const sNetBiosError = "NetBIOS错误%d";
type TMACAddress = packed array[0..5] of Byte;
ENetBiosError = class( Exception );
TAStat = record Adapt : TAdapterStatus;
NameBuff : array[0..30] of TNameBuffer;
end;
function GetMacAddress( AdapterNum : Integer ) : TMACAddress;
var
Ncb : TNCB; uRetCode : Char;
J : Integer; Adapter : TAStat;
begin
FillChar( NCB, SizeOf(NCB), 0 );
with NCB do begin
ncb_command := Char(NCBRESET);
ncb_lana_num := Char( AdapterNum );
end;
共3页。 1 2 3 8 :
1.在程序中实现用默认的Web浏览器打开URL以及发送电子邮件
uses
shellapi;
….
Procedure TForm1.Label1Click(Sender:Tobject);
begin
shellexecute(handle,"open","", nil,nil,sw_show);
end;
procedure
TForm1.Button1Click(Sender: Tobject);
begin
shellexecute(handle,"open", "mailto:user@host.com", nil, nil,sw_shownormal);
end;
2.得到网络适配器的MAC地址
//uses Windows, SysUtils, NB30, 以下为类型定义及函数代码
const sNetBiosError = "NetBIOS错误%d";
type TMACAddress = packed array[0..5] of Byte;
ENetBiosError = class( Exception );
TAStat = record Adapt : TAdapterStatus;
NameBuff : array[0..30] of TNameBuffer;
end;
function GetMacAddress( AdapterNum : Integer ) : TMACAddress;
var
Ncb : TNCB; uRetCode : Char;
J : Integer; Adapter : TAStat;
begin
FillChar( NCB, SizeOf(NCB), 0 );
with NCB do begin
ncb_command := Char(NCBRESET);
ncb_lana_num := Char( AdapterNum );
end;
共3页。 1 2 3 8 :
下载本文示例代码
delphi三十六之网络篇delphi三十六之网络篇delphi三十六之网络篇delphi三十六之网络篇delphi三十六之网络篇delphi三十六之网络篇delphi三十六之网络篇delphi三十六之网络篇delphi三十六之网络篇delphi三十六之网络篇delphi三十六之网络篇delphi三十六之网络篇delphi三十六之网络篇delphi三十六之网络篇delphi三十六之网络篇
阅读(155) | 评论(0) | 转发(0) |