Can't add a static port mapping in my c# application

前端 未结 3 1420
栀梦
栀梦 2021-01-18 05:00

I\'m trying to add new static port mapping in my c# application. Because my application runs as a server and i want its to listen on the port 8000.

NATUPNPLi         


        
3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-18 05:08

    Just based on your error message which just all we have;

    var mappings = new List();
    mappings.Add(8000, "TCP", 8000, "192.168.1.100", true, "Local Web Server");
    

    After your edit, maybe using like;

    NATUPNPLib.IStaticPortMappingCollection mappings = new StaticPortMappingCollection();
    

    Looks like you forget to use ()

提交回复
热议问题