using Sarand.Net.Standard.Base.Core; using Sarand.Net.Standard.Base.Utils; using System; using System.Collections.Generic; using System.Net; using System.Text; namespace Sarand.Net.Standard.Base.Net { public static class WebUtil { //------------------------------------------------------------------- // H T M L E n c o d i n g //------------------------------------------------------------------- /// Converts a string to an HTML-encoded string. public static String HtmlEncode (this String value) { if (StringUtil.IsEmpty(value)) return value; return WebUtility.HtmlEncode(value); } /// Converts a string that has been HTML-encoded for HTTP transmission into a decoded string. public static String HtmlDecode (this String value) { if (StringUtil.IsEmpty(value)) return value; return WebUtility.HtmlDecode(value); } //------------------------------------------------------------------- // U R L E n c o d i n g //------------------------------------------------------------------- /// Converts a string to an HTML-encoded string. public static String UrlEncode (this String value) { if (StringUtil.IsEmpty(value)) return value; return WebUtility.UrlEncode(value); } /// Converts a string that has been HTML-encoded for HTTP transmission into a decoded string. public static String UrlDecode (this String value) { if (StringUtil.IsEmpty(value)) return value; return WebUtility.UrlDecode(value); } //------------------------------------------------------------------- } }