Network Component

I available any Delphi networking component

1. see all computers in domain / workgroup?
2. can browse the network?

Karen
karen021897Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kretzschmarCommented:
0
karen021897Author Commented:
When i am install this component i get errorr in

SystemViewReg.pas

- Code

procedure Register;
begin
{$IFDEF DFS_STV_SYSTREEVIEW}
  RegisterComponents('DFS', [TSTystemTreeView]);
  RegisterPropertyEditor(TypeInfo(TDFSVersion), TSystemTreeView, 'Version',
     TDFSVersionProperty);
{$ENDIF}
{$IFDEF DFS_STV_SYSLISTVIEW}
  RegisterComponents('DFS', [TSystemListView]);
  RegisterPropertyEditor(TypeInfo(TDFSVersion), TSystemListView, 'Version',
     TDFSVersionProperty);
{$ENDIF}
end;
0
karen021897Author Commented:
I want source or component that can see all computer in domain or workgroup and i can my by my self drag and drop computers into listbox1.items
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

intheCommented:
maybe this code will help it shows to enum all pcs on network and put found computers and drives in treeview:

http://www.delphifreestuff.com/examples/wnetexmp.zip

or this code that just adds the found pc names to listview:

procedure TForm1.Button1Click(Sender: TObject);
procedure Enum(h: THandle);
var
  nr: array[0..2000] of TNetResource;
  nRes, cbBuf : Cardinal;
  i: Integer;
  he: THandle;
begin
  nRes := 100;
  cbBuf := sizeof(nr);
  FillChar(nr, sizeof(nr), 0);
  WNetEnumResource(h, nRes, @nr, cbBuf);
  for i := 0 to nRes-1 do
  begin
    if (nr[i].dwDisplayType in [RESOURCEDISPLAYTYPE_DOMAIN,
    RESOURCEDISPLAYTYPE_DIRECTORY,RESOURCEDISPLAYTYPE_SERVER]) and Assigned(nr[i].lpRemoteName) then
     Listbox1.items.add(nr[i].lpRemoteName);
      if nr[i].dwDisplayType in [RESOURCEDISPLAYTYPE_DOMAIN,
RESOURCEDISPLAYTYPE_NETWORK] then
    begin
      WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_DISK,
RESOURCEUSAGE_ALL, @nr[i], he);
      Enum(he);
      WNetCloseEnum(he);
    end;
   end;
end;
var
  he: THandle;
begin
  Listbox1.Items.Clear;
  WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_ANY,
RESOURCEUSAGE_ALL, nil, he);
  Enum(he);
  WNetCloseEnum(he);
end;

Regards Barry
0
karen021897Author Commented:
I have to say, you are the best!!!

But, can you do one thing for me

1. Put the list into Treeview

e.g

TOLVDLD // workgroup
TOLV_KAREN // ComputerName
TOLV_POPER // ComputerName

then you are !!! BBBBEEESSSSTTTTT!!!!!!!

Thanx
Karen
0
kretzschmarCommented:
well done, barry :-)

sorry karen,
but i didn't had the time to evaluate
your problem with the systree-component,
but i guess that doesn't matter now

meikl
0
intheCommented:
hi both,
this is not easy stuff so it might take a while but i see what i can do.
it might be easier to change the
wnetexmp.zip example to just get pc names.well i'll soon see.
back later
 :-))

0
intheCommented:
is this better:

procedure TForm1.Button1Click(Sender: TObject);
procedure Enum(h: THandle);
var
  nr: array[0..2000] of TNetResource;
  nRes, cbBuf : Cardinal;
  i: Integer;
  he: THandle;
begin
  nRes := 100;
  cbBuf := sizeof(nr);
  FillChar(nr, sizeof(nr), 0);
  WNetEnumResource(h, nRes, @nr, cbBuf);
  for i := 0 to nRes-1 do
  begin
  if (nr[i].dwDisplayType in [RESOURCEDISPLAYTYPE_DOMAIN]) then
    treeview1.items.add(treeview1.TopItem,pchar(nr[i].lpRemoteName));
    if (nr[i].dwDisplayType in [RESOURCEDISPLAYTYPE_DIRECTORY,RESOURCEDISPLAYTYPE_SERVER]) and Assigned(nr[i].lpRemoteName) then
     treeview1.items.addchild(treeview1.TopItem,pchar(nr[i].lpRemoteName));
      if nr[i].dwDisplayType in [RESOURCEDISPLAYTYPE_DOMAIN,
RESOURCEDISPLAYTYPE_NETWORK] then
    begin
      WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_DISK,
RESOURCEUSAGE_ALL, @nr[i], he);
      Enum(he);
      WNetCloseEnum(he);
    end;
   end;
end;
var
  he: THandle;
begin
  Listbox1.Items.Clear;
  WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_ANY,
RESOURCEUSAGE_ALL, nil, he);
  Enum(he);
  WNetCloseEnum(he);
end;

Regards Barry
merry XMas to all :-))
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
intheCommented:
mmm..i think it probably needs more but i cant test anything as i only have 2 pc's on home network so to me it looks fine but on a corporate network with many workgroups it may not be so great..i dunno ..
0
karen021897Author Commented:
I get all computers under one "workgroup name" and let's say my computer "tolv_karen" came under
"bokhdld" <--- workgroup name

I will my computer got under "tolvdld"

Is this possible?
0
intheCommented:
thats cos i added them here:
treeview1.TopItem  
its harder because like i said i cant test anything cause i only have 1 workgroup and 2 pc's ..
ill have another go later but i wont know if it works or not ..
0
intheCommented:
hi,
um did you look to this demo project:
http://www.delphifreestuff.com/examples/wnetexmp.zip

it adds them properly to a treview...
0
karen021897Author Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.