Дипломная работа: Разработка программы приема и передачи сообщений в локальной сети Microsoft
buf, p:PChar;
i, k:integer;
ch:char;
res:string;
begin
NBName:='';
GetMem (buf, size);
FillChar (ncb, SizeOf(TNCB), 0);
ncb.ncb_command:=char (NCBASTAT);
ncb.ncb_buffer:=buf;
ncb.ncb_length:=size;
for i:=1 to Length (s) do
ncb.ncb_callname [i‑1]:=UpCase (s[i]);
for i:=Length (s) to NCBNAMSZ do ncb.ncb_callname[i]:=' ';
ncb.ncb_callname [NCBNAMSZ‑1]:=#03;
ch:=netbios (addr (ncb));
if (ch<>#0) and (ncb.ncb_retcode<>#0) then Exit;
p:=ncb.ncb_buffer;
with PAdapterStatus (ncb.ncb_buffer)^ do
begin
p:=p+SizeOf (TAdapterStatus);
for i:=0 to name_count‑1 do
begin
with PNameBuffer (p)^ do
begin
if (name [NCBNAMSZ‑1]=' ') and ((ord (name_flags) and UNIQUE_NAME)=UNIQUE_NAME) then
begin
res:='';
for k:=0 to NCBNAMSZ‑2 do if name[k]<>' ' then res:=res+name[k];