C
carem1
Unregistered / Unconfirmed
GUEST, unregistred user!
我只是将combobox改成listview而已,大家都是string,现在listview里面有结果,但是显示不出来,怎么回事?
procedure TForm1.N2Click(Sender: TObject);
var
GroupList:TStringList;
ComputerList:TStringList;
i,j:integer;
begin
GroupList:=TStringList.Create;
if not GetServerList(GroupList) then //取得网络内所有工作组
begin
GroupList.Free;
Exit;
end;
ComputerList:=TStringList.Create;
for i:=0 to GroupList.Count-1 do//枚举没个工作组的计算机
begin
ComputerList.Clear;
if GetUsers(GroupList.Strings,ComputerList) then
for j:=0 to ComputerList.Count-1 do
with ListView1.Items.Add do (ComputerList.Strings);
end;
if listview1.Items.Count>0 then listview1.ItemIndex:=0;
GroupList.Free;
ComputerList.Free;
end;
procedure TForm1.N2Click(Sender: TObject);
var
GroupList:TStringList;
ComputerList:TStringList;
i,j:integer;
begin
GroupList:=TStringList.Create;
if not GetServerList(GroupList) then //取得网络内所有工作组
begin
GroupList.Free;
Exit;
end;
ComputerList:=TStringList.Create;
for i:=0 to GroupList.Count-1 do//枚举没个工作组的计算机
begin
ComputerList.Clear;
if GetUsers(GroupList.Strings,ComputerList) then
for j:=0 to ComputerList.Count-1 do
with ListView1.Items.Add do (ComputerList.Strings);
end;
if listview1.Items.Count>0 then listview1.ItemIndex:=0;
GroupList.Free;
ComputerList.Free;
end;