Пример #1
0
		static HttpRequest ()
		{
			try {
				UrlMappingsSection ums = WebConfigurationManager.GetWebApplicationSection ("system.web/urlMappings") as UrlMappingsSection;
				if (ums != null && ums.IsEnabled) {
					urlMappings = ums.UrlMappings;
					if (urlMappings.Count == 0)
						urlMappings = null;
				}

#if NET_4_0
				Version validationMode = HttpRuntime.Section.RequestValidationMode;

				if (validationMode >= new Version (4, 0)) {
					validateRequestNewMode = true;
					string invalidChars = HttpRuntime.Section.RequestPathInvalidCharacters;
					if (!String.IsNullOrEmpty (invalidChars))
						RequestPathInvalidCharacters = CharsFromList (invalidChars);
				}
#endif
			} catch {
				// unlikely to happen
			}
			
			host_addresses = GetLocalHostAddresses ();
		}
Пример #2
0
		static HttpRequest ()
		{
#if NET_2_0
			try {
				UrlMappingsSection ums = WebConfigurationManager.GetWebApplicationSection ("system.web/urlMappings") as UrlMappingsSection;
				if (ums != null && ums.IsEnabled) {
					urlMappings = ums.UrlMappings;
					if (urlMappings.Count == 0)
						urlMappings = null;
				}
			} catch {
				// unlikely to happen
			}
#endif
			
			host_addresses = GetLocalHostAddresses ();
		}