数据库中插入一篇文章,然后要显示再网页上怎么弄

2025-04-13 04:09:08
推荐回答(3个)
回答1:

DotNetTextBox3
先将普通文章进行html编码:
string lr = Server.HtmlEncode(WebEditor1.Text.Replace("'", "''"));
其中WebEditor1.Text就是输入文章的内容.
将lr写入数据库.
显录的时候读出lr;
再对lr进行回编码:
用Label1写出来.
Label1.Text=Server.HtmlDecode(Encoding.Unicode.GetString(System.Text.Encoding.Unicode.GetBytes(lr)));

使用的时候请导入system.text命名空间

回答2:

You have to believe in yourself. That's the secret of success.

回答3:

一篇文章,