-2
我正在使用帶有智能手持設備的URL進行數據庫通信的服務。在去httplistener.start()函數的同時,我得到一個Acess被拒絕的異常。如何解決這個問題。這裏我以普通用戶身份登錄。我的用戶名= NI-PC036,userdomain = User33。在httplistener的start()函數中發生異常「Acess Denied」
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();
}