如何将HTML特殊字符编码为实际值?
数据:
Antique bronze of an archer by Franz Iffland Literature:
“Bronzes, sculptors and founders” by H. Berman, Abage. 
“Dictionnaire illustré des sculpteurs animaliers & fondeurs de l’antiquité à nos jours “ by Jean Charles Hachet. Argus Valentines. 
“The dictionary of sculptors in bronze” by James Mackay. Antique collectors club. 
 Fedex shipping: $ 185
必填项:
Antique bronze of an archer by Franz Iffland Literature:
“Bronzes, sculptors and founders” by H. Berman, Abage.
“Dictionnaire illustré des sculpteurs animaliers & fondeurs de l’antiquité à nos jours “ by Jean Charles Hachet. Argus Valentines.
“The dictionary of sculptors in bronze” by James Mackay. Antique collectors club.
Fedex shipping: $ 185
答案 0 :(得分:4)
使用HtmlDecode
:
string source ="Antique bronze of an archer by Franz Iffland Literature:
“Bronzes, sculptors and founders” by H. Berman, Abage. 
“Dictionnaire illustré des sculpteurs animaliers & fondeurs de l’antiquité à nos jours “ by Jean Charles Hachet. Argus Valentines. 
“The dictionary of sculptors in bronze” by James Mackay. Antique collectors club. 
 Fedex shipping: $ 185";
string decoded= WebUtility.HtmlDecode(source);
答案 1 :(得分:1)
您可以使用
string output = WebUtility.HtmlDecode(Data);
它位于System.Net
命名空间下。
答案 2 :(得分:1)
使用HttpUtility.HtmlDecode
或WebUtility.HtmlDecode
string s = "Antique bronze of an archer by Franz Iffland Literature:
“Bronzes, sculptors and founders” by H. Berman, Abage. 
“Dictionnaire illustré des sculpteurs animaliers & fondeurs de l’antiquité à nos jours “ by Jean Charles Hachet. Argus Valentines. 
“The dictionary of sculptors in bronze” by James Mackay. Antique collectors club. 
 Fedex shipping: $ 185";
var s2 = HttpUtility.HtmlDecode(s);
var s3 = WebUtility.HtmlDecode(s);
答案 3 :(得分:1)
string res = Server.HtmlDecode("ntique bronze of an archer by Franz Iffland Literature:
“Bronzes, sculptors and founders” by H. Berman, Abage. 
“Dictionnaire illustré des sculpteurs animaliers & fondeurs de l’antiquité à nos jours “ by Jean Charles Hachet. Argus Valentines. 
“The dictionary of sculptors in bronze” by James Mackay. Antique collectors club. 
 Fedex shipping: $ 185");