教程学院
图像设计 多媒体类 机械制图 办公软件 操作系统 系统编程 网站编程 网页制作 数据库类 网络路由 网络工程 网络安全 考试认证
酷网学院
CAD
AutoCad Cam350 ProEngineer GCcam MATLAB Unigraphics SolidWorks CAXA Solid3000 Cimatron EdgeCAM
系统
安全 防火墙 病毒 WinXP Win2003 Vista
数据库
编程
网络
精彩图库
  当前位置: 库库中文网 · 网站编程教程 · JSP教程 · JSP开发实例

一个dnslookuo示例。。。

学院最新推荐文章
教程推荐
『一个dnslookuo示例。。。』如果文章有大量图片,显示会较慢,请等待图片下载完成
 
点击数: 更新时间:2005-12-23 
testform.cs
------------------------------------------------------------

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Net;

namespace testagain
{
    /// <summary>
    /// Summary description for testform.
    /// </summary>
    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;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        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
            //
        }

            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            protected override void Dispose( bool disposing )
            {
                if( disposing )
                {
                    if(components != null)
                    {
                        components.Dispose();
                    }
                }
                base.Dispose( disposing );
            }

        #region Windows Form Designer generated code
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            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);

            }
        #endregion

            private 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();
                }
            }
        }
}
 

】【关闭窗口
·上页:
·下页:
相关文章
     网站编程教程 - JSP开发实例
推荐教程webservice结合dhtml地简略示例
推荐教程webservice结合dthml地简略示例
推荐教程webservice结合dhtml地简略示例
推荐教程将复合控件子控件事件上传到顶
推荐教程VB6.0 调用存储过程地示例 (前
推荐教程VB6.0 调用存储过程地示例(办
推荐教程这是一个非常有意思地示例!(D
推荐教程转:设计模式Singleton(示例是C
推荐教程两个客户端操作TreeView节点Ch
推荐教程一个用Visual C#做组件地简略
推荐教程几个很很好的.NET 相关地FAQ和
推荐教程一个可逆加密地示例
精彩图片汇集
advertisement
关于站点 - 广告服务 - 联系我们 - 版权隐私 - 免责声明 - 合作伙伴 - 程序支持 - 网站地图 - 返回顶部
网站文本地图
版权所有:库库中文 2005-2007 欢迎各种媒体转载我们的原创作品[转载请注明出处]
copyright © 2005-2008 www.QQGB.com online services. all rights reserved. 蜀ICP备05015578
Template designed by Virus. Optimized for 1024x768 to Firefox,Opera and MS-IE6. Site powered by EQL.
红盾
热爱电脑,热爱生活
拥有电脑,拥有生命
让我们享受拥有电脑的时光