The original author's name deciduous summer article original hacker defense line (12 issues) Please contact the author, contact the original author's name deciduous summer day
I want everyone to be very familiar with scanners such as Xiaoyu Time. Do you write an impulse yourself. Recently, Microsoft has implemented the .NET strategy plan, C # is a main language, do you have interest to use C # to achieve a scan for a local area network IP address, try to write the happiness yourself, then please come with me. First introduce the class: 1. DNS class: Under the system.net namespace in .NET, the primary function is to retrieve information about a particular host from the Internet Domain Name System (DNS). 2. IPHOSTENTRY Class: Associate a Domain Name System (DNS) host with a group of aliases and a set of matching IP addresses, using the DNS class. 3. ipaddress class: address on IP network. The namespace used is: system.net Namespace provides a simple programming interface for multiple protocols used on the current network. System.io namespace contains synchronous and asynchronous reading and writing on data streams and files Types of. System.Thread namespace is mainly used to program multiple-line programs. Program implements the following features: 1. Get the local host IP address // Response for the Event of the Button control Private void buttion1_click (Object sender, system.event.Args e) {iphostentry myhost = new iphostentry (); try {// DNS.GETOSTNAME () Gets hostname // dns.getHostByname () gets the DNS information of the specified DNS host name // to get the DNS information of the local host MYHOST = DNS.GETHOSTBYNAME (DNS.GETHOSTNAME ()); // Display Local host name TextBox1.text = myhost.hostname.tostring (); // Displays the IP address table for local host (int i = 0; i