我如何在Web服务的当前目录 [英] How do I get the current directory in a web service
本文介绍了我如何在Web服务的当前目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用System.IO.Directory.GetCurrentDirectory()来获得在我的web服务的当前目录,但不给我当前目录。我如何获取当前目录中的Web服务?
I am using System.IO.Directory.GetCurrentDirectory() to get the current directory in my web service, but that does not give me the current directory. How do I get the current directory in a web service?
由于
斯图尔特
Thanks Stuart
推荐答案
在Web服务,你是在HTTP上下文中运行。因此,
In a webservice, you are running in a http context. So,
HttpContext.Current.Server.MapPath("~/")
会给你答案。
这篇关于我如何在Web服务的当前目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文