문제

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#

도움이 되었습니까?

해결책

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();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top