Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the problems with the escape of C#

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what are the problems of C# escape". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the problems of C# escape"?

Questions about the escape of C#

Public void BuilJavaEvent () {this.DataSetToXml (); this.Attributes.Add ("onkeypress", "_ javascript:var jsXml = new ActiveXObject ('Msxml2.DOMDocument'); jsXml.loadXML ('\" + document.getElementById ('XmlValue') .value +\ ";" + this.GetJavaStrHtmlID ());}

I want to return a js script to the foreground through the c # script code, but the double quotation marks (/ ") in it become" is there a way to solve it, or is there something wrong with me? "

Answer to C # escape 1

Use Replace, such as Replace ("Program Files", "\" Program Files\ ") so that Program Files becomes" Program Files ".

Answer to C # escape 2

Use\ "useless, your method is wrong, you entered through Attributes, the page is actually automatically generated onkeypress=." If in. If there are double quotation marks in it, what do you think will happen? * the double quotation marks will match the one after =, so you can't use double quotation marks here. Use single quotation marks. If you need multiple layers of nesting, you can't write this, define a function, and then call..

Answer to C # escape 3

XML automatic conversion, I have not tried to write back to the client, I usually directly Response,XML in ASP for this seems to need to use the CDATA type will not automatically convert.

At this point, I believe you have a deeper understanding of "what are the problems of C# escape?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report