添加事件及代码-C#编写的QQ程序及指导

时间:2021-04-25 02:48:19
【文件属性】:
文件名称:添加事件及代码-C#编写的QQ程序及指导
文件大小:2.01MB
文件格式:PPT
更新时间:2021-04-25 02:48:19
C# QQ 聊天程序 (4)添加事件及代码 双击“获取”按钮,其事件代码如下所示: private void button1_Click(object sender, EventArgs e) { textBox2.Text = ""; try { IPHostEntry hostInfo = Dns.GetHostEntry(textBox1.Text.Trim()); foreach (IPAddress ipadd in hostInfo.AddressList) { textBox2.Text += ipadd.ToString() + "\r\n"; } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }

网友评论