var
i:integer;
begin
opendialog1.options:=[ofallowmultiselect,offilemustexist];
if opendialog1.execute then
begin
listbox1.clear;
with opendialog1.files do
for i:=0 to count-1 do
listbox1.items.add(string[i]);//这段代码在运行时报错,
end;
label1.caption:=extractfiledir(opendialog1.files[0]);
end;请教一下, OPENDIALOG1。files.string 表示着什么,在这里string[i]表示什么
i:integer;
begin
opendialog1.options:=[ofallowmultiselect,offilemustexist];
if opendialog1.execute then
begin
listbox1.clear;
with opendialog1.files do
for i:=0 to count-1 do
listbox1.items.add(string[i]);//这段代码在运行时报错,
end;
label1.caption:=extractfiledir(opendialog1.files[0]);
end;请教一下, OPENDIALOG1。files.string 表示着什么,在这里string[i]表示什么
OpenDialog的filename是一组字符串,这样说应该能明白吧
c:\path\file1 &chr(0)& file2 &chr(0)& file3
而不是数组
strlen = Len(CDialog1.filename)
For i = 1 To strlen
i = InStr(z, CDialog1.filename, Chr(0))
If i = 0 Then Exit For
ReDim Preserve FileNames(y)
FileNames(y) = Mid(CDialog1.filename, z, i - z)
z = i + 1
y = y + 1
Next