본문 바로가기
Delphi Tip/인터넷

웹페이지 FillInForm

by MonoSoft 2021. 11. 18.
728x90
반응형

웹페이지 FillInForm

 

procedure FillInForm(WB: ShDocVW.TWebbrowser; IDoc1: IHTMLDocument2; Document: Variant;

OptionSelectedName: string);

var

IEFields: array[1..2] of string;

var

IEFieldsCounter: Integer;

i,j,m: Integer;

ovElements: OleVariant;

begin

IEFields[1] := 'file_list';

 

if Pos('frmBoard', Document.Title) <> 0 then

while WB.ReadyState <> READYSTATE_COMPLETE do

Application.ProcessMessages;

for m := 0 to Document.forms.Length - 1 do

begin

ovElements := Document.forms.Item(m).elements;

memo1.lines.add('ovElements.Length: ' + IntToStr(ovElements.Length));

for i := ovElements.Length - 1 downto 0 do

begin

try

if (ovElements.item(i).name = IEFields[1]) then

begin

//ovElements.item(i).Value := OptionSelectedName;

Memo1.lines.add('option length ' + inttostr(ovElements.item(i).options.length));

Memo1.lines.add('option '+ ovElements.fieldname.options[0].value);

// ovElements.item(i).options[0].Name := 'ddd';

// ovElements.item(i).options[0].Value := 'dddddd';

// if ovElements.item(i).options.length-1 >= 1 then

// begin

// for j := 0 to ovElements.item(i).options.length-1 do begin

// Memo1.lines.add('option ' + inttostr(j) + ' ' + ovElements.item(i).options[j].Value);

// end;

// end;

end;

except

// failed...

end;

end; { for i...}

end; { for m }

 

728x90
반응형

댓글