How to find the URL of a SharePoint web application with the URL of the Site within this

I need to find the URL of the web application for this site (let's say I have the URL http: // code / sites / java . Given the URL of this site collection, I need the URL of the web application that hosts this family sites. In this case it will be http: // code . Any input will be appreciated.

+3
source share
2 answers

, URL-, , -. , - , , ..

.

+10

:

string path= HttpContext.Current.Request.Url.Authority 

URL- -

0

Source: https://habr.com/ru/post/1719696/


All Articles