C#特殊字符快速转码


             encodeURIComponent('\n')
             "%0A"
             encodeURIComponent('\\')
             "%5C"
             encodeURIComponent('/')
             "%2F" 

          encodeURIComponent(',')
          "%2C"

          encodeURIComponent('\'')

          %27

        encodeURIComponent("\"")
        "%22"

     data = json;
     data = data.Replace("\\", "%5C").Replace("\n", "%0A");//.Replace("/","%2F");
.Replace(",", "%2C").Replace("'", "%27").Replace("\\", "%5C").Replace("\n", "%0A")

 

 
        encodeURIComponent("\"")
        "%22"
        encodeURIComponent('\\')
             "%5C"
最终


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM