I created a startup command and already off the firewall using below:
netsh advfirewall set allprofiles state off
My object is to communicate our server from our application which already hosted as a Azure cloud service.
Initially i want to execute the below code:
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 = 120000;
PingReply reply = pingSender.Send(this.txtAddress.Text, timeout, buffer, options);
if (reply.Status == IPStatus.Success)
{
lblStatus.Text += string.Format("Address: {0} <BR />", reply.Address.ToString());
lblStatus.Text += string.Format("RoundTrip time: {0} <BR />", reply.RoundtripTime);
lblStatus.Text += string.Format("Time to live: {0} <BR />", reply.Options.Ttl);
lblStatus.Text += string.Format("Don't fragment: {0} <BR />", reply.Options.DontFragment);
lblStatus.Text += string.Format("Buffer size: {0} <BR />", reply.Buffer.Length);
}
else
{
lblStatus.Text = string.Format("Error executing ping on {0}, status : {1}", txtAddress.Text, reply.Status);
}
}
catch (Exception exception)
{
lblStatus.Text = exception.Message;
}
But i always get a timout. Not any successful ping.
I am just stuck on it and any help would be highly appreciated. Thanks