public PortMappingEntry(uint port, string ip, string name, UPnP.Protocol protocol)
 {
     try
     {
         Port     = port;
         Ip       = ip;
         Name     = name;
         Protocol = protocol;
     }
     catch (Exception)
     {
         throw new InvalidCastException("Couldn't create portmapping entry");
     }
 }
示例#2
0
		public PortMappingEntry(uint port, string ip, string name, UPnP.Protocol protocol)
		{
			try
			{
				Port = port;
				Ip = ip;
				Name = name;
				Protocol = protocol;
			}
			catch (Exception)
			{
				throw new InvalidCastException("Couldn't create portmapping entry");
			}
		}
示例#3
0
		public PortMappingEntry(uint port, string ip, string name, string protocol)
		{
			try
			{
				Port = port;
				Ip = ip;
				Name = name;
				if (protocol.ToLower().Contains("udp"))
					Protocol = UPnP.Protocol.UDP;
				else
					Protocol = UPnP.Protocol.TCP;
			}
			catch (Exception)
			{
				throw new InvalidCastException("Couldn't create portmapping entry");
			}
		}
 public PortMappingEntry(uint port, string ip, string name, string protocol)
 {
     try
     {
         Port = port;
         Ip   = ip;
         Name = name;
         if (protocol.ToLower().Contains("udp"))
         {
             Protocol = UPnP.Protocol.UDP;
         }
         else
         {
             Protocol = UPnP.Protocol.TCP;
         }
     }
     catch (Exception)
     {
         throw new InvalidCastException("Couldn't create portmapping entry");
     }
 }