Hi...
Can you have any idea to connect server ip status by ping command from andriod mobile xamarine code....
if yes, pleas share your code.... if any.....
Hi...
Can you have any idea to connect server ip status by ping command from andriod mobile xamarine code....
if yes, pleas share your code.... if any.....
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit MohantyRank #112 · 20K reputationPosted Apr 4, 2023, 12:15 AM EDT
Try this
using System.Net.NetworkInformation; private async Task CheckServerStatus(string ipAddress) { Ping pingSender = new Ping(); try { PingReply reply = await pingSender.SendPingAsync(ipAddress, 1000); if (reply.Status == IPStatus.Success) return true; else return false; } catch (Exception ex) { Console.WriteLine(ex.Message); return false; } }Uday DodiyaRank #239 · 10.3K reputationPosted Apr 4, 2023, 2:45 AM EDT
Hello naga rajan,
you can try below code
using System.Net.NetworkInformation; public bool CheckIPStatus(string ipAdd) { bool isServerUp = false; try { Ping ping = new Ping(); PingReply reply = ping.Send(ipAdd); if (reply.Status == IPStatus.Success) { isServerUp = true; } } catch (Exception ex) { Console.WriteLine(ex.Message); } return isServerUp; }