static CheckTargetService() { _platform = OsPaltformMgr.GetInstance().Platform; System.Console.WriteLine($"wroking in {_platform}"); _pingCmd = new UniformPingFactory(_platform).PingCmd; }
public UniformPingFactory(OSPlatform platform) { if (OSPlatform.Windows == platform) { PingCmd = new WindowsPingCmd(); } else if (OSPlatform.Linux == platform) { PingCmd = new LinuxPingCmd(); } else { PingCmd = new MacOXPingCmd(); } }