网络编程 
首页 > 网络编程 > 浏览文章

asp.net textarea换行函数代码

(编辑:jimmy 日期: 2025/9/22 浏览:3 次 )
复制代码 代码如下:
/// <summary>
/// 替换html中的特殊字符
/// </summary>
/// <param name="theString">需要进行替换的文本。</param>
/// <returns>替换完的文本。</returns>
public string HtmlEncode(string theString)
{
theString=theString.Replace(">", "&gt;");
theString=theString.Replace("<", "&lt;");
theString=theString.Replace(" ", " &nbsp;");
theString=theString.Replace("\"", "&quot;");
theString=theString.Replace("\'", "&#39;");
theString=theString.Replace("\n", "<br/> ");
return theString;
}
上一篇:.NET发起web请求时维持Session
下一篇:asp.net cookie的操作,写入、读取与操作
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网 网站地图 SiteMap