如何解码javascript的编码字符串

如何解码javascript的编码字符串,javascript,c#,html,encoding,decode,Javascript,C#,Html,Encoding,Decode,这是用于javascript函数的编码HTML代码 <div class=\"ProductDetail\"><div style=\"width:780px\">\r\n\t<div class=\"baslik\" style=\"margin: 0px; padding: 5px 10px; border-width: 5px 0px 1px; border-top-style: solid; border-bottom-style: solid; borde

这是用于javascript函数的编码HTML代码

<div class=\"ProductDetail\"><div style=\"width:780px\">\r\n\t<div class=\"baslik\" style=\"margin: 0px; padding: 5px 10px; border-width: 5px 0px 1px; border-top-style: solid; border-bottom-style: solid; border-top-color: rgb(255, 255, 255); border-bottom-color: rgb(153, 165, 165); vertical-align: baseline; color: rgb(0, 0, 0); clear: both; line-height: 14px; font-family: 'Lucida Grande', sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(219, 223, 226);\">    Di\u011fer \u00d6zellikler<\/div><\/div><\/div>
\r\n\t Di\u011fer\u00d6zellikler
当正确解码时,它将变为下面

<div class="ProductDetail"><div style="width:780px">
<div class="baslik" style="margin: 0px; padding: 5px 10px; border-width: 5px 0px 1px; border-top-style: solid; border-bottom-style: solid; border-top-color: rgb(255, 255, 255); border-bottom-color: rgb(153, 165, 165); vertical-align: baseline; color: rgb(0, 0, 0); clear: both; line-height: 14px; font-family: 'Lucida Grande', sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(219, 223, 226);">    Diğer Özellikler</div></div></div>

迪尔奥泽利克勒
该网站具有解码和编码功能

我可以在c#中找到
HttpUtility.JavaScriptStringEncode
,但是我找不到任何函数类等来解码编码的字符串

所以我需要关于如何像那个网站那样解码的帮助

.net 4.5 c#

您是否尝试过:

        var unescapedString = Microsoft.JScript.GlobalObject.unescape(yourEscapedString);
        var escapedString = Microsoft.JScript.GlobalObject.escape(yourUnescapedString);
您应该将Microsoft.JScript的引用添加到您的项目中。

您是否尝试过:

        var unescapedString = Microsoft.JScript.GlobalObject.unescape(yourEscapedString);
        var escapedString = Microsoft.JScript.GlobalObject.escape(yourUnescapedString);

你应该在你的项目中添加
Microsoft.JScript
引用。

哇,我刚刚发现答案很简单

然而,这里有许多经验丰富的开发人员投票通过了我之前的帖子:D

单行线和工程完美

Regex.Unescape(string);

哇,答案很简单,我才发现

然而,这里有许多经验丰富的开发人员投票通过了我之前的帖子:D

单行线和工程完美

Regex.Unescape(string);

显示的编码足以生成JavaScript文本。这不需要任何额外的解码,因为解释器将为您执行此操作。

显示的编码足以生成JavaScript文本。这不需要任何额外的解码,因为解释器会为您进行解码。

为什么不右键单击他们的页面,查看他们正在使用的Javascript
[查看源代码]
,并将其添加到您的页面中。。答案其实就在眼前you@DJKRAZE我在c#而不是JavaScription上需要它。你不能将javascript添加到你的c#吗?如果不能,那么我为我的错误道歉comment@DJKRAZE不是你不能添加的。另外,他们的脚本很难理解,因为你甚至可以猜到为什么不右键单击他们的页面,查看他们正在使用的Javascript
[查看源代码]
,并将其添加到你的页面中。。答案其实就在眼前you@DJKRAZE我在c#而不是JavaScription上需要它。你不能将javascript添加到你的c#吗?如果不能,那么我为我的错误道歉comment@DJKRAZE不是你不能添加的。另外,他们的脚本很难理解,你可以猜到,甚至可能是加密的,在我的例子中,我必须加载解码到htmlagilitypack中,所以我必须解码。实际上,在我的例子中,我必须加载解码到htmlagilitypack中,所以我必须解码