var i:Integer; s:string; begin for i:=0 to ListBox1.Items.Count-1 do if ListBox1.Selected[i] then s:=s+ListBox1.Items[i]+','; showmessage(s); end;
我这样做了的还是不行啊 if CheckBox2.Checked then begin listbox1.SelectAll;//这里是做了个全选么??? for i := 0 to ListBox1.Count - 1 do begin if ListBox1.Selected[i] = True then ip := ListBox1.Items.Strings[i]; ret := JBC7K2_Record(@ATrecord[0], block, pchar(ip), port); end; end else begin ret := JBC7K2_Record(@ATrecord[0], block, pchar(ip), port); end;
if CheckBox2.Checked then begin listbox1.SelectAll;//这里是做了个全选么??? for i := 0 to ListBox1.Count - 1 do begin if ListBox1.Selected[i] = True then ip := ListBox1.Items.Strings[i]; ret := JBC7K2_Record(@ATrecord[0], block, pchar(ip), port); end; end else begin ret := JBC7K2_Record(@ATrecord[0], block, pchar(ip), port); end; 怎么做这个 IP才会循环赋值呢
i:Integer;
s:string;
begin
for i:=0 to ListBox1.Items.Count-1 do
if ListBox1.Selected[i] then
s:=s+ListBox1.Items[i]+','; showmessage(s);
end;
if CheckBox2.Checked then begin
listbox1.SelectAll;//这里是做了个全选么???
for i := 0 to ListBox1.Count - 1 do begin
if ListBox1.Selected[i] = True then
ip := ListBox1.Items.Strings[i];
ret := JBC7K2_Record(@ATrecord[0], block, pchar(ip), port);
end;
end
else begin
ret := JBC7K2_Record(@ATrecord[0], block, pchar(ip), port);
end;
listbox1.SelectAll;//这里是做了个全选么???
for i := 0 to ListBox1.Count - 1 do begin
if ListBox1.Selected[i] = True then
ip := ListBox1.Items.Strings[i];
ret := JBC7K2_Record(@ATrecord[0], block, pchar(ip), port);
end;
end
else begin
ret := JBC7K2_Record(@ATrecord[0], block, pchar(ip), port);
end;
怎么做这个 IP才会循环赋值呢