how can I get list of active LAN user using ARP

2019-09-15 02:14发布

in command prompt we can get list of ACTIVE user's IP [on LAN] using command like

arp - g

How can I get similar list using C#

1条回答
迷人小祖宗
2楼-- · 2019-09-15 02:35

You can use Process to execute commands from c# program

Try This:

        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();
查看更多
登录 后发表回答