获取网络/DNS后缀的IP地址范围 [英] Getting IP address range of a network/DNS suffix
本文介绍了获取网络/DNS后缀的IP地址范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好.
我想知道有什么方法可以获取网络的IP地址范围或DNS后缀名称.
例如,当我在命令提示符下键入ipconfig时,我将获得以下信息
Hello.
I want to know is there any way we can get an ip address range of an network or DNS suffix name.
Example, when i type ipconfig in commandprompt, i will get information as below
<pre lang="css">
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : COMPANY-NAME-MY
Link-local IPv6 Address . . . . . : fe80::3134:1e1b:f018:7280%22
IPv4 Address. . . . . . . . . . . : 192.168.2.140
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.2.1
</pre>
我想从我的c-sharp页面获取特定于连接的DNS后缀值.是否可以?
谢谢.
i want to get Connection-specific DNS Suffix value from my c-sharp page..is it possible?
thanks.
推荐答案
try
{
System.Diagnostics.ProcessStartInfo runcmd =
new System.Diagnostics.ProcessStartInfo("cmd", "/c " + "ipconfig");
runcmd.RedirectStandardOutput = true;
runcmd.UseShellExecute = false;
runcmd.CreateNoWindow = true;
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = runcmd;
proc.Start();
string result = proc.StandardOutput.ReadToEnd();
textBox1.Text = result;
}
catch (Exception objException)
{
// write here you carch.
}
希望这对您有帮助...
hope this helps...
这篇关于获取网络/DNS后缀的IP地址范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文