我正在使用带有智能手持设备的 url 进行数据库通信的服务。在这里,当我去 httplistener.start() 函数时,我得到了一个拒绝访问的异常。如何解决这个问题。在这里,我以普通用户身份登录。我的用户名 =NI-PC036,用户域 = User33。
urlExecuter = new UrlExecuter();
eventStop = new ManualResetEvent(false);
MySql.Start();
// HTTP
httpListener = new HttpListener();
httpListener.Prefixes.Add("http://*/");
httpListener.Start();
httpListener.BeginGetContext(new AsyncCallback(HttpListenerCallback), httpListener);
httpListener.BeginGetContext(new AsyncCallback(HttpListenerCallback), httpListener);
cleanupThread = new Thread(delegate()
{
while (!eventStop.WaitOne(5 * 60 * 1000)) // 5Min
{
try
{
if (cleanupTime.AddDays(1) < DateTime.Now)
{
int days = MiscTool.ReadIni<int>("SERVICE", "KEEP", 60);
Cleanup.Execute(days);
cleanupTime = DateTime.Now.Date;
}
}
catch (Exception ex)
{
Program.WriteExceptionLog("cleanupThread", ex);
}
}
});
cleanupThread.Start();
}