Elinize sağlık.
Kodları siz yazdığınız için tamamını burada paylaşıyorum. İşine yarayan olur belki. İyi forumlar dilerim.
Kod:
{unit}
unit uGocSorgu2;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.OleCtrls, SHDocVw;
type
TfGocSorgu2 = class(TForm)
Panel1: TPanel;
btnSORGULA: TButton;
edtURL: TEdit;
Panel2: TPanel;
edt_basvuruNo: TEdit;
edt_ePosta: TEdit;
edt_pasaportBelgeNo: TEdit;
btnHTTP: TButton;
btnJSON: TButton;
WebBrowser1: TWebBrowser;
procedure btnSORGULAClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
fGocSorgu2: TfGocSorgu2;
implementation
uses
Registry, MSHTML;
{$R *.dfm}
procedure DaktiloGiris(aText: string);
var
i: Integer;
begin
Application.ProcessMessages;
for i := 1 to Length(aText) do
begin
case aText[i] of
'@':
begin
WinApi.Windows.Keybd_Event(VK_RMENU, 0, 0, 0);
WinApi.Windows.Keybd_Event(ord('Q'), 0, 0, 0);
WinApi.Windows.Keybd_Event(VK_RMENU, 1, KEYEVENTF_KEYUP, 0);
WinApi.Windows.Keybd_Event(ord('Q'), 1, KEYEVENTF_KEYUP, 0);
end;
'.':
begin
WinApi.Windows.Keybd_Event(190, 0, 0, 0);
WinApi.Windows.Keybd_Event(190, 1, KEYEVENTF_KEYUP, 0);
end;
else
begin
WinApi.Windows.Keybd_Event(ord(UpperCase(aText[i])[1]), 1, 0, 0);
WinApi.Windows.Keybd_Event(ord(UpperCase(aText[i])[1]), 1, KEYEVENTF_KEYUP, 0);
end;
end;
end;
Application.ProcessMessages;
end;
procedure TfGocSorgu2.btnSORGULAClick(Sender: TObject);
begin
WebBrowser1.Silent := True;
WebBrowser1.Navigate(edtURL.Text);
while WebBrowser1.ReadyState <> READYSTATE_COMPLETE do
begin
Sleep(1);
Application.ProcessMessages;
end;
WebBrowser1.OleObject.Document.GetElementById('basvuruNo').focus;
DaktiloGiris(edt_basvuruNo.Text);
WebBrowser1.OleObject.Document.GetElementById('ePosta').focus;
DaktiloGiris(edt_ePosta.Text);
WebBrowser1.OleObject.Document.GetElementById('pasaportBelgeNo').focus;
DaktiloGiris(edt_pasaportBelgeNo.Text);
end;
procedure TfGocSorgu2.FormCreate(Sender: TObject);
var
LReg: TRegistry;
begin
LReg := TRegistry.Create;
try
LReg.RootKey := HKEY_CURRENT_USER;
LReg.OpenKey('\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', True);
LReg.WriteInteger(ExtractFileName(Application.ExeName), 11001);
LReg.CloseKey;
finally
LReg.Free;
end;
end;
end.
{Form text}
object fGocSorgu2: TfGocSorgu2
Left = 0
Top = 0
Caption = 'SORGULAMA EKRANI'
ClientHeight = 712
ClientWidth = 1048
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poDesktopCenter
WindowState = wsMaximized
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 0
Top = 17
Width = 1048
Height = 24
Align = alTop
BevelKind = bkFlat
BevelOuter = bvNone
TabOrder = 0
ExplicitLeft = -197
ExplicitWidth = 1245
object btnSORGULA: TButton
Left = 303
Top = 0
Width = 103
Height = 20
Cursor = crHandPoint
Align = alLeft
Caption = 'SORGULA'
TabOrder = 0
OnClick = btnSORGULAClick
end
object edtURL: TEdit
Left = 0
Top = 0
Width = 303
Height = 20
Align = alLeft
TabOrder = 1
Text = 'https://e-ikamet.goc.gov.tr/Ikamet/DevamEdenBasvuruGiris'
ExplicitHeight = 21
end
end
object Panel2: TPanel
Left = 0
Top = 0
Width = 1048
Height = 17
Align = alTop
BevelOuter = bvNone
TabOrder = 1
ExplicitLeft = -197
ExplicitWidth = 1245
object edt_basvuruNo: TEdit
Left = 0
Top = 0
Width = 105
Height = 17
Align = alLeft
TabOrder = 0
Text = '2021-52-1550160'
ExplicitHeight = 21
end
object edt_ePosta: TEdit
Left = 105
Top = 0
Width = 200
Height = 17
Align = alLeft
TabOrder = 1
Text = 'metropol10metropol114@gmail.com'
ExplicitHeight = 21
end
object edt_pasaportBelgeNo: TEdit
Left = 305
Top = 0
Width = 103
Height = 17
Align = alLeft
TabOrder = 2
Text = 'FA1241759'
ExplicitHeight = 21
end
object btnHTTP: TButton
Left = 898
Top = 0
Width = 75
Height = 17
Cursor = crHandPoint
Align = alRight
Caption = 'HTTP'
TabOrder = 3
ExplicitLeft = 1095
end
object btnJSON: TButton
Left = 973
Top = 0
Width = 75
Height = 17
Cursor = crHandPoint
Align = alRight
Caption = 'JSON'
TabOrder = 4
ExplicitLeft = 1170
end
end
object WebBrowser1: TWebBrowser
Left = 0
Top = 41
Width = 1048
Height = 671
Align = alClient
TabOrder = 2
ExplicitLeft = 248
ExplicitTop = 288
ExplicitWidth = 300
ExplicitHeight = 150
ControlData = {
4C000000506C00005A4500000000000000000000000000000000000000000000
000000004C000000000000000000000001000000E0D057007335CF11AE690800
2B2E126208000000000000004C0000000114020000000000C000000000000046
8000000000000000000000000000000000000000000000000000000000000000
00000000000000000100000000000000000000000000000000000000}
end
end