WCF getting the phisical path of URL adress
I'm new at WCF and i'm trying to create a service, it needs to convert url to server path. For example开发者_如何学编程: Gets -> "www.sample.com/client1" Returns -> "c://samplefolder/sampleproject/client1"
I'm trying this code:
string realPath = HostingEnvironment.MapPath(URL);
but I get The relative virtual path 'http://localhost:5353' is not allowed here
Does anyone knows what i'm doing wrong? Thanks
Try with the relative path. Instead of the url "http://www.sample.com/client1" use "~/client1" (the symbol '~' specifies the root folder of your application)
精彩评论