string version= string.Empty;
XmlDocument doc=new XmlDocument();
//取得windir (C:/WINDOWS)
string syspath = System.Environment.GetEnvironmentVariable("windir").ToString();
//取得Microsoft.NET Framework version
version=System.Reflection.Assembly.GetExecutingAssembly().ImageRuntimeVersion.ToString();
//取得machine.config path
string systempath = syspath + "/Microsoft.NET/Framework/" + version + "/CONFIG";
doc.Load(Path.Combine(systempath,"machine.config"));
XmlNode node=doc.SelectSingleNode(" configuration/system.web/httpRuntime/@maxRequestLength");
string maxRequestLength = Convert.ToDouble(node.Value);
XmlDocument doc=new XmlDocument();
//取得windir (C:/WINDOWS)
string syspath = System.Environment.GetEnvironmentVariable("windir").ToString();
//取得Microsoft.NET Framework version
version=System.Reflection.Assembly.GetExecutingAssembly().ImageRuntimeVersion.ToString();
//取得machine.config path
string systempath = syspath + "/Microsoft.NET/Framework/" + version + "/CONFIG";
doc.Load(Path.Combine(systempath,"machine.config"));
XmlNode node=doc.SelectSingleNode(" configuration/system.web/httpRuntime/@maxRequestLength");
string maxRequestLength = Convert.ToDouble(node.Value);