开发者

Path to report in .net Windows Service

开发者 https://www.devze.com 2023-02-27 01:21 出处:网络
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

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

精彩评论

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