using System.Web;
namespace CallCenter.Utility
{
public enum DateInterval
{
Second, Minute, Hour, Day, Week, Month, Quarter, Year
}
///
/// 网页字符串专用类
///
public class WebString
{
///
/// 获取邮件@后的部分
///
///
///
public static string GetEmailHostName(string strEmail)
{
if (strEmail.IndexOf("@", System.StringComparison.Ordinal) < 0)
{
return "";
}
return strEmail.Substring(strEmail.LastIndexOf("@", System.StringComparison.Ordinal)).ToLower();
}
///
/// 返回 HTML 字符串的编码结果
///
/// 字符串
/// 编码结果
public static string HtmlEncode(string str)
{
return HttpUtility.HtmlEncode(str);
}
///
/// 返回 HTML 字符串的解码结果
///
/// 字符串
/// 解码结果
public static string HtmlDecode(string str)
{
return HttpUtility.HtmlDecode(str);
}
///
/// 返回 URL 字符串的编码结果
///
/// 字符串
/// 编码结果
public static string UrlEncode(string str)
{
return HttpUtility.UrlEncode(str);
}
///
/// 返回 URL 字符串的编码结果
///
/// 字符串
/// 解码结果
public static string UrlDecode(string str)
{
return HttpUtility.UrlDecode(str);
}
}
}