doğrulama kodunu göstermek için
Function AradanSec( text, ilk, son:widestring ): String; // html parse için fonksiyon
begin
Delete(Text, 1, pos(ilk, Text) + Length(ilk)-1);
Result := Copy(Text, 1, Pos(Son, Text)-1);
end;
function indir(Source, Dest : String): Boolean; // RESMİ DOWNLOAD ETMEK İÇİN FONKSİYON
begin
try
Result := URLDownloadToFile(nil,PChar(Source),PChar(Dest),0,nil) = 0
except
Result := False;
end;
end;
procedure tform1.resimal();
var
s : widestring;
s1: string;
begin
// memoyu temizledik
memo1.Lines.Clear;
//kaynak kodları memoya aldık
Memo1.lines.Text := IdHTTP1.Get(UTF8Encode('http://tckimlik.nvi.gov.tr/Web/QueryIdentityNumber.aspx'));
// html i parseledik
s := Memo1.Lines.Text;
s1:= AradanSec(s,'<img src="KPSImages.axd?type=dynamicimage&Val=' , ' " id="mimgSecurityCode" ');
// resmi indirdik
indir('http://tckimlik.nvi.gov.tr/Web/KPSImages.axd?type=dynamicimage&Val='+s1,'C:\a.gif');
// image a yükledik ...
Image1.Picture.LoadFromFile('C:\a.gif');
end;
arkadaÅŸlar
s1:= AradanSec(s,'<img src="KPSImages.axd?type=dynamicimage&Val=' , '" id="mimgSecurityCode"'); bu satıda
Syntax Highlighter şaşıryor kırmızı olan kısım gibi olucak
sorgulamak içinde aşağıdaki kodu kullanmıştım sitedeki textbox ların içini doldruyor ama il ve ilçede çakıyor..
post veya get işlemiyle oturum kodunu falan da parselemek gerekiyor fazla uğraşmadığım için ssadece böyle denemiştim..
geliÅŸtirilebilir..
var
Doc: IHTMLDocument2;
tik : OleVariant;
begin
WebBrowser1.Navigate( 'http://tckimlik.nvi.gov.tr/Web/QueryIdentityNumber.aspx');
While WebBrowser1.ReadyState <> READYSTATE_Complete do
Application.ProcessMessages;
WebBrowser1.OleObject.Document.GetElementByID('ctlCity').Value :='35';
WebBrowser1.OleObject.Document.GetElementByID('ctlDistrict').Value :='1819';
WebBrowser1.OleObject.Document.GetElementByID('ctlFirstName').Value :='Ali';
WebBrowser1.OleObject.Document.GetElementByID('ctlLastName').Value :='YEŞİLOĞLU';
WebBrowser1.OleObject.Document.GetElementByID('mnbxSecurityCode').value :=Edit3.Text;
WebBrowser1.OleObject.Document.GetElementByID('ctlCilt').Value :='51';
WebBrowser1.OleObject.Document.GetElementByID('ctlAileSiraNo').Value :='00789';
WebBrowser1.OleObject.Document.GetElementByID('ctlSiraNo').Value :='0028';
WebBrowser1.OleObject.Document.GetElementByID('ctlFatherName').Value :='Kenan';
WebBrowser1.OleObject.Document.GetElementByID('ctlMotherName').Value :='Kıymet';
WebBrowser1.OleObject.Document.GetElementByID('ctlBirthDate').Value :='1988';
WebBrowser1.OleObject.Document.GetElementByID('ctlSex').Value :='E';
Doc := IHTMLDocument2(WebBrowser1.Document);
tik := WebBrowser1.oleobject.Document.GetElementByID('ctlQueryFromData');
tik.Click;
şeklinde denemiştim bende zamanında ama il ve ilçede takıldım

ili seçtikten sonra sayfa kendini yeniliyor ve ilçe listesini güncelliyor..
fazla durmamıştım üstünde zaten...