how can I get list of active LAN user using ARP

旧城冷巷雨未停 提交于 2019-12-12 00:42:17

问题


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:


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();


来源:https://stackoverflow.com/questions/20707604/how-can-i-get-list-of-active-lan-user-using-arp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!