karen021897
asked on
Network Component
I available any Delphi networking component
1. see all computers in domain / workgroup?
2. can browse the network?
Karen
1. see all computers in domain / workgroup?
2. can browse the network?
Karen
ASKER
When i am install this component i get errorr in
SystemViewReg.pas
- Code
procedure Register;
begin
{$IFDEF DFS_STV_SYSTREEVIEW}
RegisterComponents('DFS', [TSTystemTreeView]);
RegisterPropertyEditor(Typ eInfo(TDFS Version), TSystemTreeView, 'Version',
TDFSVersionProperty);
{$ENDIF}
{$IFDEF DFS_STV_SYSLISTVIEW}
RegisterComponents('DFS', [TSystemListView]);
RegisterPropertyEditor(Typ eInfo(TDFS Version), TSystemListView, 'Version',
TDFSVersionProperty);
{$ENDIF}
end;
SystemViewReg.pas
- Code
procedure Register;
begin
{$IFDEF DFS_STV_SYSTREEVIEW}
RegisterComponents('DFS', [TSTystemTreeView]);
RegisterPropertyEditor(Typ
TDFSVersionProperty);
{$ENDIF}
{$IFDEF DFS_STV_SYSLISTVIEW}
RegisterComponents('DFS', [TSystemListView]);
RegisterPropertyEditor(Typ
TDFSVersionProperty);
{$ENDIF}
end;
ASKER
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
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_DOMAI N,
RESOURCEDISPLAYTYPE_DIRECT ORY,RESOUR CEDISPLAYT YPE_SERVER ]) and Assigned(nr[i].lpRemoteNam e) then
Listbox1.items.add(nr[i].l pRemoteNam e);
if nr[i].dwDisplayType in [RESOURCEDISPLAYTYPE_DOMAI N,
RESOURCEDISPLAYTYPE_NETWOR K] then
begin
WNetOpenEnum(RESOURCE_GLOB ALNET, RESOURCETYPE_DISK,
RESOURCEUSAGE_ALL, @nr[i], he);
Enum(he);
WNetCloseEnum(he);
end;
end;
end;
var
he: THandle;
begin
Listbox1.Items.Clear;
WNetOpenEnum(RESOURCE_GLOB ALNET, RESOURCETYPE_ANY,
RESOURCEUSAGE_ALL, nil, he);
Enum(he);
WNetCloseEnum(he);
end;
Regards Barry
http://www.delphifreestuff.com/examples/wnetexmp.zip
or this code that just adds the found pc names to listview:
procedure TForm1.Button1Click(Sender
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_DOMAI
RESOURCEDISPLAYTYPE_DIRECT
Listbox1.items.add(nr[i].l
if nr[i].dwDisplayType in [RESOURCEDISPLAYTYPE_DOMAI
RESOURCEDISPLAYTYPE_NETWOR
begin
WNetOpenEnum(RESOURCE_GLOB
RESOURCEUSAGE_ALL, @nr[i], he);
Enum(he);
WNetCloseEnum(he);
end;
end;
end;
var
he: THandle;
begin
Listbox1.Items.Clear;
WNetOpenEnum(RESOURCE_GLOB
RESOURCEUSAGE_ALL, nil, he);
Enum(he);
WNetCloseEnum(he);
end;
Regards Barry
ASKER
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
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
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
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
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
:-))
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
:-))
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 ..
ASKER
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?
"bokhdld" <--- workgroup name
I will my computer got under "tolvdld"
Is this possible?
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 ..
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 ..
hi,
um did you look to this demo project:
http://www.delphifreestuff.com/examples/wnetexmp.zip
it adds them properly to a treview...
um did you look to this demo project:
http://www.delphifreestuff.com/examples/wnetexmp.zip
it adds them properly to a treview...
ASKER
Thanks
take a look to this
http://www.pobox.com/~bstowers/delphi/mine/files/systree.zip
meikl