2
ドメインにpingを実行しようとすると、登録されているかどうかを確認するための応答コードが表示されます。次のコードから一定の肯定的な結果を得る - アイデア?Pinging Domain C#
public static string Check(string keyword)
{
Ping pingSender = new Ping();
PingOptions options = new PingOptions();
// Use the default Ttl value which is 128,
// but change the fragmentation behavior.
options.DontFragment = true;
// Create a buffer of 32 bytes of data to be transmitted.
string data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
byte[] buffer = Encoding.ASCII.GetBytes(data);
int timeout = 120;
PingReply reply = pingSender.Send(keyword, timeout, buffer, options);
if (reply.Status == IPStatus.Success)
{
return "found";
}
else
{
return "not found";
}
}
private void hunt_Click(object sender, EventArgs e)
{
string keyword = txtKeyword.Text;
txtOutput.Text = Check(keyword);
}
任意のヘルプが
実行しようとしたキーワードを書き込めますか? –
[ヘッダーチェックのC#は常に403ですか?](http://stackoverflow.com/questions/8874839/header-check-c-sharp-is-always-403) – Jason
私は上記のコードを実行しようとしましたドメイン "www.goosdfdsgle.com"を取得し、ソケット例外をスローします。これは、通常、ホスト名解決時の一時的なエラーで、ローカルサーバーが信頼できるサーバーからの応答を受信しなかったことを意味します。正しい動作のようです。 – Slugart