以编程方式存储Xml内容 [英] Storing Xml content programatically

查看:110
本文介绍了以编程方式存储Xml内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在以下列格式获取数据表单文本框。我想将这些数据保存在文件中,但它给出的错误如下:

检测到一个潜在危险的Request.Form值客户

(kmlString =请告诉我如何以编程方式保存文件中的后续数据



I am getting data form text box in following format.I want to save this data in file but it is giving error like:
A potentially dangerous Request.Form value was detected from the client
(kmlString="Please tell me how i can save following data in file programatically

<xml version="1.0" encoding="UTF-8" ?><kml xmlns="http://www.opengis.net/kml/2.2">  
<Document>    
<Placemark>     
< name><![CDATA[</name>    
<  description><![CDATA[</description>      
<LineString>      
 < extrude>1      
  <altitudeMode>relativeToGround  
      < coordinates>     
     75.794677734375,20.571081893508193,0   
       77.783203125,21.54506606426624,0     
     79.442138671875,20.210656234489843,0    
      76.036376953125,18.979025953255267,0   
       73.333740234375,19.580493479202538,0    
      73.80615234375,20.34462694382967,0      
    75.794677734375,20.571081893508193,0     
  < /coordinates>  
  <  /LineString>    
</Placemark> 
</Document>

推荐答案

两个选项:

1.在将XML传递给请求之前对XML进行编码或

2.将请求验证设置为OFF。



选项2不可取,因为它打开了安全漏洞。

参考: ASP.NET 4.0检测到潜在危险的Request.Form值 [ ^ ]

从客户端检测到潜在危险请求。窗体值 [ ^ ]
Two options:
1. Encode the XML before passing it in the request OR
2. Set request validation to OFF.

Option 2 is not suggestible as it opens up the security hole.
Refer: ASP.NET 4.0 potentially dangerous Request.Form value was detected[^]
A Potentially Dangerous Request.Form Value Was Detected From Client[^]


这篇关于以编程方式存储Xml内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆