How do I get the current directory in a web service

前端 未结 7 831
情歌与酒
情歌与酒 2020-12-09 08:04

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 curren

7条回答
  •  [愿得一人]
    2020-12-09 08:42

    In a webservice, you are running in a http context. So,

    HttpContext.Current.Server.MapPath("~/") 
    

    will give you the answer.

提交回复
热议问题