【问题标题】:how can I get list of active LAN user using ARP如何使用 ARP 获取活动 LAN 用户列表
【发布时间】:2014-01-09 13:13:08
【问题描述】:

在命令提示符下,我们可以使用类似命令获取 ACTIVE 用户的 IP [on LAN] 列表

arp - g

如何使用 C# 获得类似列表

【问题讨论】:

  • 为什么不像往常一样运行该命令,并查看程序的结果?
  • 如何从 c# app 运行命令提示符代码?
  • @mebjas:您可以使用Process 类从c# 程序中执行commands,请参阅下面的答案。

标签: c# network-programming lan arp


【解决方案1】:

您可以使用Process 执行来自c# program 的命令

试试这个:

        Process process = new Process();
        ProcessStartInfo startInfo = new ProcessStartInfo();
        startInfo.FileName = "arp";
        startInfo.Arguments = "-g";
        startInfo.RedirectStandardOutput = true;
        startInfo.UseShellExecute = false;
        process.StartInfo = startInfo;

        process.Start();
        String strData = process.StandardOutput.ReadToEnd();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-07-06
    • 2013-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-20
    • 2012-12-03
    相关资源
    最近更新 更多