. Net calls JScript and JS url encryption and decryption

Source: Internet
Author: User

. Net uses the escape and unescape methods:

In C #, use escape and unescape to add reference: Microsoft. JScript

String strEscaped = Microsoft. JScript. GlobalObject. escape ("test ");

Note: Some js functions are all stored under GlobalObject in jscript.net.

Similarly, you can use functions such as unescape, encodeURI, and decodeURI.

Or Server. UrlDecode (Cells );

For most URL parameters. For decryption.

JS url encryption and decryption: encoding (escape, encodeURI, encodeURIComponent), decoding (unescape, decodeURI, decodeURIComponent)

1. encodeURIComponent is required when passing parameters so that the combined url will not be truncated by special characters such.

2. encodeURI can be used for url redirection.

3. You can use escape when js uses data.

4. When encoding unicode values other than 0-, escape outputs % u *** format. In other cases, escape, encodeURI, and encodeURIComponent have the same encoding result.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.