//로그인 정보을 읽어오자.
private
{ Private declarations }
procedure GetUserInfo;
public
{ Public declarations }
end;
Ctrl + Shift + C 하고 아래 코드를 입력한다.
procedure TForm1.GetUserInfo;
var
iStrings: TStrings;
idx: Integer;
begin
with KHOpenAPI1 do begin
Label1.Caption := GetLoginInfo('USER_ID');
Label2.Caption := GetLoginInfo('USER_NAME');
iStrings := TStringList.Create;
try
iStrings.Delimiter := ';';
iStrings.DelimitedText := GetLoginInfo('ACCNO');
for idx := 0 to iStrings.Count - 1 do ComboBox1.Items.Add(iStrings[idx]);
finally iStrings.Free;
end;
end;
end;
procedure TForm1.KHOpenAPI1EventConnect(ASender: TObject; nErrCode: Integer);
begin
if nErrCode = 0 then begin
ListBox1.Items.Add('로그인 성공');
GetUserInfo;
end
else
ListBox1.Items.Add('로그인 실패(Code):' + IntToStr(nErrCode));
end;