using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace OAuth2Studyl.OAuthClient { public static class BaseUrlExt { public static string UrlDomain(this HttpRequestBase requestBase) { if (requestBase == null) { throw new ArgumentNullException("requestBase","参数不能为空"); } return requestBase.Url.ToString().Split('?')[0]; } } }