此代码的文本框而不是消息框
我想知道如何添加一个文本框,通过每个地址/行的新行显示 MAC 地址。
所以它看起来像这样:
1: 00:DC:FF:AE:BC:40
2: 00:0C:F6:DE:BA:30
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection moc = mc.GetInstances();
string MACAddress = "";
foreach (ManagementObject mo in moc)
{
if (mo["MacAddress"] != null)
{
MACAddress = mo["MacAddress"].ToString();
MessageBox.Show(MACAddress);
}
}
I would like to know how can I add a Textbox that displays the MAC Addresses by a new line for each address/line.
So it would look something like this:
1: 00:DC:FF:AE:BC:40
2: 00:0C:F6:DE:BA:30
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection moc = mc.GetInstances();
string MACAddress = "";
foreach (ManagementObject mo in moc)
{
if (mo["MacAddress"] != null)
{
MACAddress = mo["MacAddress"].ToString();
MessageBox.Show(MACAddress);
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用换行符 (\n) 的组合并将文本框设置为多行模式。有关详细信息,请参阅多行文本框多个换行符。
Use a combination of newline characters (\n) and setting the textbox to multiline mode. See Multiline TextBox multiple newline for more info.