I'm trying to use C# and HttpListener
with a prefix of anything other than localhost and it fails (i.e. if I give it server1
, i.e.
http://localhost:1234
works, but
http://server1:1234
fails
The code is...
HttpListener listener = new HttpListener();
String prefix = @"http://server1:1234";
listener.Prefixes.Add(prefix);
listener.Start();
The failure occurs on listener.Start()
with an exception of Access is denied.
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…