Asp.Net XML²Ù×÷»ùÀà
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Xml;
using System.Text;
using MSXML2;
namespace EC
{
/// <summary>
/// XML ²Ù×÷»ùÀà
/// </summary>
public class XmlObject : IDisposable
{
//ÒÔÏÂΪµ¥Ò»¹¦Äܵľ²Ì¬Àà
#region ¶ÁÈ¡XMLµ½DataSet
/**************************************************
* º¯ÊýÃû³Æ:GetXml(string XmlPath)
* ¹¦ÄÜ˵Ã÷:¶ÁÈ¡XMLµ½DataSet
* ²Î Êý:XmlPath:xmlÎĵµÂ·¾¶
* ʹÓÃʾÁÐ:
* using EC; //ÒýÓÃÃüÃû¿Õ¼ä
* string xmlPath = Server.MapPath("/EBDnsConfig/DnsConfig.xml"); //»ñÈ¡xml·¾¶
* DataSet ds = EC.XmlObject.GetXml(xmlPath); //¶ÁÈ¡xmlµ½DataSetÖÐ
************************************************/
/// <summary>
/// ¹¦ÄÜ:¶ÁÈ¡XMLµ½DataSetÖÐ
/// </summary>
/// <param name="XmlPath">xml·¾¶</param>
/// <returns>DataSet</returns>
public static DataSet GetXml(string XmlPath)
{
DataSet ds = new DataSet();
ds.ReadXml(@XmlPath);
return ds;
}
#endregion
#region ¶ÁÈ¡xmlÎĵµ²¢·µ»ØÒ»¸ö½Úµã
/**************************************************
* º¯ÊýÃû³Æ:ReadXmlReturnNode(string XmlPath,string Node)
* ¹¦ÄÜ˵Ã÷:¶ÁÈ¡xmlÎĵµ²¢·µ»ØÒ»¸ö½Úµã:ÊÊÓÃÓÚÒ»¼¶½Úµã
* ²Î Êý: XmlPath:xmlÎĵµÂ·¾¶;Node ·µ»ØµÄ½ÚµãÃû³Æ
* ÊÊÓ¦ÓÃXml:<?xml version="1.0" encoding="utf-8" ?>
* <root>
* <dns1>ns1.everdns.com</dns1>
* </root>
* ʹÓÃʾÁÐ:
Ïà¹ØÎĵµ£º
Ò»¡¢asp.netÖе¼³öExeclµÄ·½·¨£º ÔÚ asp.netÖе¼³öExeclÓÐÁ½ÖÖ·½·¨£¬Ò»ÖÖÊǽ«µ¼³öµÄÎļþ´æ·ÅÔÚ·þÎñÆ÷ij¸öÎļþ¼ÐÏÂÃ棬Ȼºó½«ÎļþµØÖ· Êä³öÔÚä¯ÀÀÆ÷ÉÏ£»Ò»ÖÖÊǽ«ÎļþÖ±½Ó½«ÎļþÊä³öÁ÷д¸øä¯ÀÀÆ÷¡£ÔÚResponseÊä³öʱ£¬\t·Ö¸ôµÄÊý¾Ý£¬µ¼³ö execlʱ£¬µÈ¼ÛÓÚ·ÖÁУ¬\nµÈ¼ÛÓÚ»»
Ò»¡¢asp.netÖе¼³öExeclµÄ·½·¨£º
ÔÚ asp.netÖе¼³öE ......
1¡¢IsStartupScriptRegistered£º¶ÔÏóÊÇ·ñ×¢²áÁËÆôÓýű¾¡£
2¡¢IsClientScriptBlockRegistered£º¶ÔÏóÊÇ·ñ×¢²áÁË¿Í»§¶Ë½Å±¾¿é¡£
3¡¢IsClientScriptIncludeRegistered£º¶ÔÏóÊÇ·ñ×¢²áÁË¿Í»§¶Ë½Å±¾°üº¬¡£
µÚÒ»¸öÀý×Ó£º
string info = "<script>alert('ÄãºÃÂð£¿');</script>";
//ÅжÏʼþÊÇ·ñ±»×¢²á£¬Ð´ÈëÇ ......
ÎÒÃÇÔÚÊ״β¿ÊðmvcµÄÏîĿʱͨ³£»áÓöµ½Ò»µãÎÊÌâ¡£M$ÒѾÔÚGlobal.asax.csÎļþÖаüº¬ÁËÕâÁ½¾ä×¢Ê͵ÄÌáʾ¡£
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
µ«ÊÇÎÒÃÇ·ÃÎÊÕâ¸öÍøÖ·¿´µ½ÉÏÃæµÄÎÄÕ¶Ôiis5.1(win ......
Ç°ÃæÎÄÕÂÖÐÌáµ½ xml½ÚµãµÄɾ³ý
“ɾ³ý <book genre="fantasy" ISBN="2-3631-4">½ÚµãµÄgenreÊôÐÔ£¬É¾³ý <book genre="updateÌÕά¼Ñ" ISBN="2-3631-4">½Úµã¡£”
´úÂ룺
XmlNodeList xnl=xmlDoc.SelectSingleNode("bookstore").ChildNodes;
foreach(XmlNode&nbs ......
IIS 7 ĬÈÏÎļþÉÏ´«´óСʱ30M
ҪͻÆÆÕâ¸öÏÞÖÆ£º
1. ÐÞ¸ÄIISµÄapplicationhost.config
´ò¿ª %windir%\system32\inetsrv\config\applicationhost.config
ÕÒµ½£º <requestFiltering>½Úµã£¬
Õâ¸ö½ÚµãĬÈÏûÓÐ <requestLimits maxAllowedContentLength="ÉÏ´« ......