http://wiki.overbyte.eu/wiki/index.php?title=TPing.DNSResult&feed=atom&action=historyTPing.DNSResult - Revision history2024-03-29T09:44:09ZRevision history for this page on the wikiMediaWiki 1.34.0http://wiki.overbyte.eu/wiki/index.php?title=TPing.DNSResult&diff=3489&oldid=prevMarkus.humm: Created page2019-01-29T22:29:49Z<p>Created page</p>
<p><b>New page</b></p><div>[[Main_Page | Main page]] -> [[ICS_Components_Reference | ICS component reference]] -> [[TPing]] -> [[TPing.DNSResult | DNSResult]]<br />
<br />
== Definition ==<br />
<br />
'''property''' DNSResult: '''string''';<br />
<br />
== Description ==<br />
If the [[TPing.Address | address]] property is specified as DNS address instead of an IP address, a DNS lookup will be performed by the ping component. <br />
The DNSResult property will contain the IPv4 or IPv6 address of the remote host specified in address property. Be aware that this information is being<br />
queried in the background and thus is not available immediately. It is available when the [[TPing.OnDNSLookupDone | OnDNSLookupDone]] event fired.<br />
<br />
== Example ==<br />
<br />
<syntaxhighlight lang="delphi"><br />
<br />
unit MainForm;<br />
<br />
interface<br />
<br />
uses<br />
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,<br />
Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,<br />
OverbyteIcsWndControl, OverbyteIcsPing, Vcl.StdCtrls;<br />
<br />
type<br />
TForm1 = class(TForm)<br />
Ping1: TPing;<br />
Button1: TButton;<br />
procedure Ping1DnsLookupDone(Sender: TObject; Error: Word);<br />
procedure Button1Click(Sender: TObject);<br />
private<br />
public<br />
end;<br />
<br />
var<br />
Form1: TForm1;<br />
<br />
implementation<br />
<br />
{$R *.dfm}<br />
<br />
procedure TForm1.Button1Click(Sender: TObject);<br />
begin<br />
Ping1.DnsLookup('wikipedia.org');<br />
end;<br />
<br />
procedure TForm1.Ping1DnsLookupDone(Sender: TObject; Error: Word);<br />
begin<br />
ShowMessage(Ping1.DnsResult);<br />
end;<br />
<br />
end.<br />
<br />
</syntaxhighlight><br />
<br />
== Best practices ==<br />
<br />
Process the contents of this property in OnDNSLookupDone event if the Error parameter of this event is 0.<br />
<br />
== How to ==</div>Markus.humm