Mình có 1 form App, khi no chay len se load 1 so web browser , dong thoi se ghi lại URL cua nhung page đã load.
Giờ cần viết 1 windown service chạy ngầm bên dưới, mỗi 1 phút sẽ chay 1 lần.

Hiện tại Khi chạy windown service thì nó ko load được form , nhung lại ghi duoc cac URL ra file *.txt.
Code minh nhu sau, ai biet chi gium mình làm sao co the load duoc cả form len luon :

public partial class wsWebBrowser : ServiceBase
{
private ManualResetEvent _shutdownEvent = new ManualResetEvent(false);
private Thread _thread;

public wsWebBrowser()
{
InitializeComponent();
if (!(System.Diagnostics.EventLog.SourceExists("wsWeb Browser_Source")))
{
System.Diagnostics.EventLog.CreateEventSource("wsW ebBrowser_Source", "wsWebBrowser_Log");
}
wsWebBrowserEventLog.Source = "wsWebBrowser_Source";
wsWebBrowserEventLog.Log = "wsWebBrowser_Log";
}

protected override void OnStart(string[] args)
{
_thread = new Thread(exewsWebBrowser);
_thread.Name = "wsWebBrowser";
_thread.IsBackground = true;
_thread.Start();

}
private void exewsWebBrowser()
{
while (!_shutdownEvent.WaitOne(0))
{
ProcessStartInfo chuongtrinh = new ProcessStartInfo();
chuongtrinh.WorkingDirectory = @"E:\Projects\FrmWebBrowser\bin\Release";
chuongtrinh.FileName = "FrmWebBrowser.exe";
Process.Start(chuongtrinh);

_thread.Join(60000);
}
}

protected override void OnStop()
{
_shutdownEvent.Set();
if (!_thread.Join(3000))
{
_thread.Abort();
}
}
}