在WCF服务中访问App_Data [英] Access App_Data in WCF service

查看:38
本文介绍了在WCF服务中访问App_Data的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在WCF服务中访问App_Data文件夹?

How to access App_Data folder in WCF service?

我放置了一个xslt文件,但找不到该路径.

I have placed a xslt file and I am not able to find the path.

推荐答案

您需要使用HostingEnvironment.ApplicationPhysicalPath:

You need to use HostingEnvironment.ApplicationPhysicalPath:

string myXsltFilename = Path.Combine(HostingEnvironment.ApplicationPhysicalPath, "App_Data", "my.xslt");

这篇关于在WCF服务中访问App_Data的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆