开发者

Access Application Folder

开发者 https://www.devze.com 2023-04-02 14:03 出处:网络
I am developing a webapplication using asp.net mvc 3. In the solution I have a project for all the web/presentation things (models, views, controller) and in another project I have my services, daos

I am developing a webapplication using asp.net mvc 3.

In the solution I have a project for all the web/presentation things (models, views, controller) and in another project I have my services, daos and domainobject. now I created a config-file in my service-project with some settings. how can I access the file from my services?

If I don't set a path it uses the path of the as开发者_JAVA技巧p.net exe.

Hope someone can help Tobi


You can use AppDomain.CurrentDomain.BaseDirectory to get proper path. Or change Build action property of your config file to Embedded Resource (msdn). After that you will be able to retrieve file using ResourceManager

0

精彩评论

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

关注公众号