在程序中实现用默认的Web浏览器打开URL以及发送电子邮件......
作者:陈立平 来源:yesky 2007年11月1日
关键字:
uRetCode := Netbios( @Ncb );
if uRetCode $#@60;$#@62; #0 then raise Exception.CreateFmt( sNetBIOSError, [Ord(uRetCode)] );
FillChar( NCB, SizeOf(NCB), 0 );
with NCB do begin
ncb_command := Char(NCBASTAT);
ncb_lana_num := Char( AdapterNum );
StrCopy( ncb_callname, "* " );
ncb_buffer := @Adapter;
ncb_length := sizeof(Adapter);
end;
uRetCode := Netbios( @Ncb );
if uRetCode $#@60;$#@62; #0 then raise Exception.CreateFmt( sNetBIOSError, [Ord(uRetCode)] );
for J := 0 to 5 do
Result[J] := Ord( Adapter.Adapt.Adapter_address[J] );
end;
3.得到当前网络用户的登录名
function GetNetUser : Ansistring;
var
dwI : Dword;
begin
dwI := MAX_PATH;
SetLength (Result, dwI + 1);
if WNetGetUser (Nil, Pchar (Result), dwI) = NO_ERROR then
SetLength (Result, StrLen (Pchar (Result)))
else
SetLength (Result, 0)
end;