You are local or remote in c#

Check if your app is local or remote. It’s useful for working with different local file structure than the server.

public static bool isLocal
{
    get
    {
        if (HttpContext.Current.Request.Url.Authority.IndexOf("localhost") > -1)
            return true;
        return false;
    }
}
Facebook Comments