Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Form1.cs
Package: Demo16xxx00.rar [view]
Upload User: jsz11269
Upload Date: 2017-01-14
Package Size: 450k
Code Size: 2k
Category:
Email Server
Development Platform:
C#
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using System.Net;
- namespace UseDNS
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- lbHost.Text = Dns.GetHostName();
- IPHostEntry Host = Dns.GetHostEntry(lbHost.Text);
- //IPHostEntry Host = Dns.GetHostByName(lbHost.Text);
- lbHost.Text = "本机域名为:" + lbHost.Text + ",IP地址为:" + Host.AddressList[0].ToString();
- }
- private void getDomain_Click(object sender, EventArgs e)
- {
- try
- {
- if (tbIP.Text != "")
- {
- IPHostEntry Host = Dns.GetHostEntry(lbHost.Text); //Dns.GetHostByAddress(tbIP.Text);
- tbDomain.Text = Host.HostName;
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message.ToString());
- }
- }
- private void btnGetIP_Click(object sender, EventArgs e)
- {
- try
- {
- if (tbDomain.Text != "")
- {
- IPHostEntry Host = Dns.GetHostEntry(tbDomain.Text);
- tbIP.Text = Host.AddressList[0].ToString();
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message.ToString());
- }
- }
- }
- }