亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何將ConsoleWrite更改為標簽文本

如何將ConsoleWrite更改為標簽文本

C#
蠱毒傳說 2021-05-10 12:16:20
好吧,我一直在使用我的IP Get和console.write函數,但是有一個問題,我不知道Console.Write做什么,我只需要該代碼進入Label文本,即當IP獲取時,它將轉到Label.Text BTW,我使用Visual Studio c#。private void metroLabel1_Click(object sender, EventArgs e)    {         String strHostName = string.Empty;         // Getting Ip address of local machine...         // First get the host name of local machine.         strHostName = Dns.GetHostName();         Console.WriteLine("Local Machine's Host Name: " + strHostName);         // Then using host name, get the IP address list..         IPHostEntry ipEntry = Dns.GetHostEntry(strHostName);         IPAddress[] addr = ipEntry.AddressList;         for (int i = 0; i < addr.Length; i++)         {             Console.WriteLine("IP Address {0}: {1} ", i, addr[i].ToString());            //metroLabel1.Text = " >> " + "", i, addr[i].ToString());           // Console.WriteLine = metroLabel1.Text;        }         Console.ReadLine();    }
查看完整描述

2 回答

?
哆啦的時光機

TA貢獻1779條經驗 獲得超6個贊

試試這個

metroLabel1.Text = inputString


查看完整回答
反對 回復 2021-05-29
  • 2 回答
  • 0 關注
  • 146 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號