As in windows application,we can never find the startup path of an application using
Application.StartupPath in windows service.
We can find the startup path of a windows service using Reflection.Include the given code in your service and get the startup path returned.
Hope this helps..
private string StartPath
{
get
{
return System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly()
.GetName().CodeBase).Substring(6);
}
}
5 comments:
thanks
Thanks Boss. Really helped me.
Thanks for letting us know that it helped you in your efforts.
Great Thank! It's really helpful for me. :)
Thnx bro......
Its really good thing which i need...
Post a Comment