示例#1
0
        static CheckTargetService()
        {
            _platform = OsPaltformMgr.GetInstance().Platform;

            System.Console.WriteLine($"wroking in {_platform}");

            _pingCmd = new UniformPingFactory(_platform).PingCmd;
        }
示例#2
0
 public UniformPingFactory(OSPlatform platform)
 {
     if (OSPlatform.Windows == platform)
     {
         PingCmd = new WindowsPingCmd();
     }
     else if (OSPlatform.Linux == platform)
     {
         PingCmd = new LinuxPingCmd();
     }
     else
     {
         PingCmd = new MacOXPingCmd();
     }
 }