जब तक आप अपने सबनेट में कंप्यूटर की जांच करना चाहते हैं तो आप इसे ARP का उपयोग करके देख सकते हैं। यहां एक उदाहरण दिया गया है:
//for sending an arp request (see pinvoke.net)
[DllImport("iphlpapi.dll", ExactSpelling = true)]
public static extern int SendARP(
int DestIP,
int SrcIP,
byte[] pMacAddr,
ref uint PhyAddrLen);
public bool IsComputerAlive(IPAddress host)
{
//can't check the own machine (assume it's alive)
if (host.Equals(IPAddress.Loopback))
return true;
//Prepare the magic
//this is only needed to pass a valid parameter
byte[] macAddr = new byte[6];
uint macAddrLen = (uint)macAddr.Length;
//Let's check if it is alive by sending an arp request
if (SendARP((int)host.Address, 0, macAddr, ref macAddrLen) == 0)
return true; //Igor it's alive!
return false;//Not alive
}
अधिक जानकारी के लिए Pinvoke.net देखें।
आपको किस पोर्ट से कनेक्ट करने की आवश्यकता है? दिए गए फ़ायरवॉल - नेटवर्क-व्यापी और प्रति-प्रणाली - एक प्रणाली आसानी से उपलब्ध हो सकती है लेकिन अगर आप कोशिश करने के लिए गलत बंदरगाह चुनते हैं तो प्रतिक्रिया नहीं दे रहे हैं। – tvanfosson
बीटीडब्ल्यू, मैं बस इतना कहना चाहूंगा कि जब कोई नेटवर्क शामिल होता है, तो परिभाषा के अनुसार कोई "निर्धारणात्मक" विधि मौजूद नहीं हो सकती है। http://en.wikipedia.org/wiki/Deterministic_algorithm – paxos1977