就是在textarea打入:
===============
<a href="../../bbs/">重庆工学院机器人足球网站新版论坛</a>开张!欢迎其他同类网站交换链接!
===============
<a href="../../bbs/">重庆工学院机器人足球网站新版论坛</a>开张!欢迎其他同类网站交换链接!
解决方案 »
- 新手诚信请教asp.net c# 操作xml的问题
- FCkeditor在asp.net加载问题
- 再请教:使用了FCKeditor,并且在win2003server下发布网站的XDJM进!!
- 在自己的网站上传JPG图片的格式居然有的不能显示!!!!郁闷.......
- Repeater的分页
- aspx文件往html写入返回值
- 文件上传的问题_不知哪错了..
- 如何查询从textbox.text得到的关键字?
- ASP.NET Web应用程序中添加Web窗体服务器控件问题
- 搞不懂了,请求帮忙!
- 请问在ASP里面的CHR(32)在C#里面换成什么表示?多谢
- asp.net中向access中增加新记录返回自动编号值的问题
你要显示的内容
。
。
。
</textarea>
.Text_border01
{
font-size: 10pt;
color: #000000;
overflow:auto;
line-height:20px;
SCROLLBAR-FACE-COLOR: white;
SCROLLBAR-HIGHLIGHT-COLOR: #DEDEDE;
SCROLLBAR-SHADOW-COLOR: #DEDEDE;
SCROLLBAR-3DLIGHT-COLOR: #ffffff;
SCROLLBAR-ARROW-COLOR: #A6A6A6;
SCROLLBAR-TRACK-COLOR: #F0F0F0;
SCROLLBAR-DARKSHADOW-COLOR: #000000;
SCROLLBAR-BASE-COLOR: rgb(66,93,128);
overflow-x:hidden;
border: 0px solid #999999;
}
public String Spaceschange(String str){ StringBuffer buf = new StringBuffer(str);
// final String sSpace = new String("\'");
final String sSpace1 = new String("\"");
final String sSpace2 = new String("′");
final String sSpace3 = new String("\\");
final String sSpace4 = new String("<");
final String sSpace5 = new String(">");
int i = 0;
while (i < buf.length())
{
if (buf.charAt(i) == '"')
{
buf.replace(i, i + 1, sSpace1);
i += sSpace1.length();
}
else if(buf.charAt(i)=='\''){
buf.replace(i, i + 1,sSpace2);
i +=sSpace2.length();
}
else if(buf.charAt(i)=='\\'){
buf.replace(i, i + 1,sSpace3);
i +=sSpace3.length();
}
else if(buf.charAt(i)=='<'){
buf.replace(i, i+1,sSpace4);
i+=sSpace4.length();
}
else if(buf.charAt(i)=='>'){
buf.replace(i, i+1,sSpace5);
i+=sSpace5.length();
}
else
{
i++;
}
}
return new String(buf);
}
private string Replaceletter(string str)
{
str=str.Replace(" "," ");
str=str.Replace("<","<");
str=str.Replace(">",">");
str=str.Replace("‘","‘");
str=str.Replace("’","’");
return str;
}
你试试看能不能通过?
我打<a test>
用你得函数成为
<a test>
插入后被转义为
&lt;a test&gt;
了!郁闷!
是不是sql server有什么转义功能哟,还是asp.net提交得时候有转义功能哟!!!
Str = Str.Replace(">", ">")
Str = Str.Replace("'", "''")
Str = Str.Replace(" ", " ")
Str = Str.Replace("\n", "<br/>")
Str = Str.Replace("\r\n", "<br/>")
Str = Str.Trim()
Return str
End Function