Oppure

Loading
27/10/09 18:05
camaleonteplus
Ho trovato un modo comodo per fare un whois sfruttando i servizi che si trovano in rete, ho trovato questo sito:
whois.domaintools.com
che se si completa l'indirizzo in questo modo:
whois.domaintools.com/…
mi da i dati relativi al IP che mi interessa, allora ho realizzato questo codice usando un componente TLabel da dove prende l'IP:
procedure TForm1.WhoisClick(Sender: TObject);
begin
 ShellExecute(0, nil, 'http://whois.domaintools.com/' + IPLocale, nil, nil, 0);
end;

Ma mi da questo errore:
[Error] Email.pas(779): Incompatible types: 'String' and 'TLabel'
lo ho fatto anche in questo modo:
procedure TForm1.WhoisClick(Sender: TObject);
begin
 ShellExecute(0, nil, 'http://whois.domaintools.com/' + IPLocale.text, nil, nil, 0);
end;

ma mi da questo errore:
[Error] Email.pas(779): Undeclared identifier: 'text'
come posso risolvere questo problema?
aaa
27/10/09 18:14
theprogrammer
Probabilmente la proprietà è Caption non Text
aaa
27/10/09 19:43
camaleonteplus
procedure TForm1.WhoisClick(Sender: TObject);
begin
 ShellExecute(0, nil, 'http://whois.domaintools.com/' + IPLocale.Caption, nil, nil, 0);
end;

be ho fatto in questo modo ma mi da questo errore:
[Error] Email.pas(779): Incompatible types: 'String' and 'PAnsiChar'
aaa
27/10/09 21:28
lorenzo
ovviamente visto che stai usando un'api di windows è necessario passare in ingresso un puntatore a char, quindi un PChar

quindi

ShellExecute(0, nil, PChar('whois.domaintools.com/' + IPLocale.Caption), nil, nil, 0);
aaa
28/10/09 8:36
camaleonteplus
grazie lorenzo:

begin
ShellExecute(0, nil, PChar('whois.domaintools.com/' + IPLocale.Caption), nil, nil, 0);
end;

aaa