开发者

Windows service access folder under project

开发者 https://www.devze.com 2023-03-06 06:46 出处:网络
I am trying to work on a service where I need to export a report into a folder under the service project and email it to the user.The delete the report when complete.The issue I am having is I need to

I am trying to work on a service where I need to export a report into a folder under the service project and email it to the user. The delete the report when complete. The issue I am having is I need to know how to access a folder under the project. I know you can use System.AppDomain.CurrentDomain.BaseDirectory to get into the bin where the excuting file is but I want to get to a folder is this possible? If not开发者_运维技巧 is there a way of creating the folder under the bin directory and accessing it. I can manually create a folder under the bin but didnt really want to do that. Any help is greatly appreciated.


Instead of using Application path, better option for temp files is Temp directory or AppData directory. You may not get write access to the installed directory.

0

精彩评论

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