try { TcpClient tcp = new TcpClient(); tcp.Connect("RemoteIP", Convert.ToInt16(135)); Console.WriteLine("online"); } catch (Exception ex) { Console.WriteLine("offline"); Console.WriteLine(ex.Message); }
Type NetFwMgrType = Type.GetTypeFromProgID("HNetCfg.FwMgr", REMOTEIP, false); INetFwMgr mgr = (INetFwMgr)Activator.CreateInstance(NetFwMgrType); Firewallenabled = mgr.LocalPolicy.CurrentProfile.FirewallEnabled; return Firewallenabled;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)