C# HttpListener The format of the specified network name is not valid

前端 未结 1 827
野趣味
野趣味 2020-12-19 08:08

I have this tiny piece of code where I try to add prefixes for my HttpListener:

listener = new HttpListener();
listener.Prefixes.Add(\"http://19         


        
相关标签:
1条回答
  • 2020-12-19 08:28

    You probably forgot to configure your system to listen for HTTP protocol communication coming from the specified IP address. Try running the following command to include it:

    netsh http add iplisten 192.168.0.108
    

    Once this is done, check the list of the addresses (in which your IP should now appear):

    netsh http show iplisten
    

    and then try to run your code again.

    0 讨论(0)
提交回复
热议问题