一个dnslookuo例子。。。


所属类别:.NET

文章作者:佚名

特别推荐:免费发布信息 承包关键词~~抢爆了!HOT!


testform.cs------------------------------------------------------------using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Net;namespace testagain{/// /// Summary description for testform./// public class testform : System.Windows.Forms.Form{private System.Windows.Forms.TextBox txt_Domain;private System.Windows.Forms.Button btn_Find;private System.Windows.Forms.Label lbl_result;/// /// Required designer variable./// private System.ComponentModel.Container components = null;public testform(Form f_MainForm){//// Required for Windows Form Designer support//InitializeComponent();this.MdiParent = f_MainForm;//// TODO: Add any constructor code after InitializeComponent call//}/// /// Clean up any resources being used./// protected override void Dispose( bool disposing ){if( disposing ){if(components != null){components.Dispose();}}base.Dispose( disposing );}#region Windows Form Designer generated code/// /// Required method for Designer support - do not modify/// the contents of this method with the code editor./// private void InitializeComponent(){this.txt_Domain = new System.Windows.Forms.TextBox();this.lbl_result = new System.Windows.Forms.Label();this.btn_Find = new System.Windows.Forms.Button();this.SuspendLayout();//// txt_Domain//this.txt_Domain.Location = new System.Drawing.Point(104, 56);this.txt_Domain.Name = "txt_Domain";this.txt_Domain.Size = new System.Drawing.Size(240, 21);this.txt_Domain.TabIndex = 1;this.txt_Domain.Text = "www.yahoo.com";//// lbl_result//this.lbl_result.Location = new System.Drawing.Point(112, 112);this.lbl_result.Name = "lbl_result";this.lbl_result.Size = new System.Drawing.Size(336, 40);this.lbl_result.TabIndex = 0;//// btn_Find//this.btn_Find.Location = new System.Drawing.Point(360, 56);this.btn_Find.Name = "btn_Find";this.btn_Find.Size = new System.Drawing.Size(72, 24);this.btn_Find.TabIndex = 2;this.btn_Find.Text = "DNSLookUp";this.btn_Find.Click += new System.EventHandler(this.btn_Find_Click);//// testform//this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);this.ClientSize = new System.Drawing.Size(536, 329);this.Controls.AddRange(new System.Windows.Forms.Control[] {this.btn_Find,this.txt_Domain,this.lbl_result});this.MaximizeBox = false;this.MinimizeBox = false;this.Name = "testform";this.ShowInTaskbar = false;this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;this.Text = "testform";this.WindowState = System.Windows.Forms.FormWindowState.Maximized;this.ResumeLayout(false);}#endregionprivate void btn_Find_Click(object sender, System.EventArgs e){lbl_result.Text = "正在解析中,请稍候...";IPHostEntry ip = Dns.GetHostByName(this.txt_Domain.Text);IPAddress[] ipaddr = ip.AddressList;for (int i=0;i<ipaddr.Length;i++){lbl_result.Text += "\r\n" + ipaddr[i].ToString();}}}}关闭本页

相关信息

· 在Win 2000中启用“兼容性”功能

· 在html页面中包含共享页面的方法

· 新闻分类录入、显示系统

· 深入理解Symbian控件架构








....

18935 24505