开发者

Path to report in .net Windows Service

I开发者_如何转开发 have a crystal report in the root directory of the .Net Windows service application. If it is a web application I specify something like below

 rptDoc.Load(Server.MapPath("myReport.rpt"));

How do I need to specify if it is a windows service?

thanks in advance.


Try this: Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)

When your hosting a windows service, the current directory can sometimes be tricky to obtain.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜