-
-
-
-
- public static string GetUrl()
- {
- return string.Format("http://{0}{1}", HttpContext.Current.Request.ServerVariables["HTTP_HOST"].ToString(), HttpContext.Current.Request.Url.PathAndQuery.ToString());
- }
-
-
-
-
- public static string GetUrlPath(string url)
- {
- return url.Substring(url.LastIndexOf("/"));
- }
-
-
-
-
- public static string GetFilename(string url)
- {
- if (url == null) { return ""; }
- string[] strs1 = url.Split(new char[] { '/' });
- return strs1[strs1.Length - 1].Split(new char[] { '?' })[0];
- }
-
-
-
-
-
-
- public static string GetDomainUrl(string url)
- {
- string newUrl;
-
- newUrl = url.ToLower().Replace("\\", "/").Replace("http:
-
-
- if (newUrl.IndexOf('/') == -1)
- {
- newUrl = "http://" + newUrl; return newUrl;
- }
- newUrl = newUrl.Substring(0, newUrl.IndexOf('/'));
-
- newUrl = "http://" + newUrl;
- return newUrl;
- }