end;
procedure tsessioninfo502obj.setsesi502_username(const value: widestring);
begin
fsesi502_username := value;
end;
{ tfileinfo3obj }
constructor tfileinfo3obj.create(fileinfo3: tfileinfo3);
begin
ffi3_id := fileinfo3.fi3_id;
ffi3_permissions := fileinfo3.fi3_permissions;
ffi3_num_locks := fileinfo3.fi3_num_locks;
ffi3_pathname := fileinfo3.fi3_pathname;
ffi3_username := fileinfo3.fi3_username;
end;
procedure tfileinfo3obj.setfi3_id(const value: dword);
begin
ffi3_id := value;
end;
procedure tfileinfo3obj.setfi3_num_locks(const value: dword);
begin
ffi3_num_locks := value;
end;
procedure tfileinfo3obj.setfi3_pathname(const value: widestring);
begin
ffi3_pathname := value;
end;
procedure tfileinfo3obj.setfi3_permissions(const value: dword);
begin
ffi3_permissions := value;
end;
procedure tfileinfo3obj.setfi3_username(const value: widestring);
begin
ffi3_username := value;
end;
{ tfileinfo50obj }
constructor tfileinfo50obj.create(fileinfo50: tfileinfo50);
begin
ffi50_id := fileinfo50.fi50_id;
ffi50_permissions := fileinfo50.fi50_permissions;
ffi50_num_locks := fileinfo50.fi50_num_locks;
ffi50_pathname := fileinfo50.fi50_pathname;
ffi50_username := fileinfo50.fi50_username;
ffi50_sharename := fileinfo50.fi50_sharename;
end;
procedure tfileinfo50obj.setfi50_id(const value: integer);
begin
ffi50_id := value;
end;
procedure tfileinfo50obj.setfi50_num_locks(const value: word);
begin
ffi50_num_locks := value;
end;
procedure tfileinfo50obj.setfi50_pathname(const value: string);
begin
ffi50_pathname := value;
end;
procedure tfileinfo50obj.setfi50_permissions(const value: word);
begin
ffi50_permissions := value;
end;
procedure tfileinfo50obj.setfi50_sharename(const value: string);
begin
ffi50_sharename := value;
end;
procedure tfileinfo50obj.setfi50_username(const value: string);
begin
ffi50_username := value;
end;
{ ttraffic }
constructor ttraffic.create(mibifrow: tmibifrow);
begin
fcaption := string(mibifrow.bdescr);
fmac := getmac(tmac(mibifrow.bphysaddr), mibifrow.dwphysaddrlen);
fdwinoctets := mibifrow.dwinoctets;
fdwoutoctets := mibifrow.dwoutoctets;
end;
procedure ttraffic.setcaption(const value: string);
begin
fcaption := value;
end;
procedure ttraffic.setdwinoctets(const value: integer);
begin
fdwinoctets := value;
end;
procedure ttraffic.setdwoutoctets(const value: integer);
begin
fdwoutoctets := value;
end;
procedure ttraffic.setmac(const value: string);
begin
fmac := value;
end;
function ttraffic.getmac(value: tmac; length: dword): string;
var
i: integer;
begin
if length = 0 then result := '00-00-00-00-00-00' else
begin
result := '';
for i := 0 to length - 2 do
result := result + inttohex(value[i], 2) + '-';
result := result + inttohex(value[length - 1], 2);
end;
end;
{ tsessioninfo2obj }
constructor tshareinfo2obj.create(shareinfo2: tshareinfo2);
begin
fshi2_netname := shareinfo2.shi2_netname;
fshi2_path := shareinfo2.shi2_path;
end;
procedure tshareinfo2obj.setshi2_netname(const value: string);
begin
fshi2_netname := value;
end;
procedure tshareinfo2obj.setshi2_path(const value: string);
begin
fshi2_path := value;
end;
{ tshareinfo50obj }
constructor tshareinfo50obj.create(shareinfo50: tshareinfo50);
begin
fshi50_netname := shareinfo50.shi50_netname;
fshi50_path := shareinfo50.shi50_path;
end;
procedure tshareinfo50obj.setshi50_netname(const value: string);
begin
fshi50_netname := value;
end;
procedure tshareinfo50obj.setshi50_path(const value: string);
begin
fshi50_path := value;
end;
end.
unit netsendutils;
interface
uses classes, windows;
procedure getnetgroupnamelist(names: tstrings);
procedure getcomputernamelist(groupname: string; names: tstrings);
implementation
procedure getnetgroupnamelist(names: tstrings);
var
lphenum: thandle;
buf1, buf2: pointer;
count, bufsize, res: dword;
p: ^tnetresource;
i, j: integer;
list: tlist;
netresource: tnetresource;
begin
//获取整个网络中的文件资源的句柄,lphenum为返回名柄