Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / HTTPNotFoundHandler.cs / 1305376 / HTTPNotFoundHandler.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
* Synchronous Http request handler interface
*
* Copyright (c) 1998 Microsoft Corporation
*/
namespace System.Web {
///
/// Provides a synchronous Http request handler interface.
///
internal class HttpNotFoundHandler : IHttpHandler {
internal HttpNotFoundHandler() {
}
///
/// Drives web processing execution.
///
public void ProcessRequest(HttpContext context) {
PerfCounters.IncrementCounter(AppPerfCounter.REQUESTS_NOT_FOUND);
throw new HttpException(404,
SR.GetString(SR.Path_not_found, context.Request.Path));
}
///
/// Indicates whether an HttpNotFoundHandler instance can be recycled and used
/// for another request.
///
public bool IsReusable {
get { return true; }
}
}
internal class HttpForbiddenHandler : IHttpHandler {
internal HttpForbiddenHandler() {
}
///
/// Drives web processing execution.
///
public void ProcessRequest(HttpContext context) {
PerfCounters.IncrementCounter(AppPerfCounter.REQUESTS_NOT_FOUND);
throw new HttpException(403,
SR.GetString(SR.Path_forbidden, context.Request.Path));
}
///
/// Indicates whether an HttpForbiddenHandler instance can be recycled and used
/// for another request.
///
public bool IsReusable {
get { return true; }
}
}
///
/// Provides a synchronous Http request handler interface.
///
internal class HttpMethodNotAllowedHandler : IHttpHandler {
internal HttpMethodNotAllowedHandler() {
}
///
/// Drives
/// web processing execution.
///
public void ProcessRequest(HttpContext context) {
throw new HttpException(405,
SR.GetString(SR.Path_forbidden, context.Request.HttpMethod));
}
///
/// Indicates whether an HttpForbiddenHandler instance can be recycled and used
/// for another request.
///
public bool IsReusable {
get { return true; }
}
}
///
/// Provides a synchronous Http request handler interface.
///
internal class HttpNotImplementedHandler : IHttpHandler {
internal HttpNotImplementedHandler() {
}
///
/// Drives web processing execution.
///
public void ProcessRequest(HttpContext context) {
throw new HttpException(501,
SR.GetString(SR.Method_for_path_not_implemented, context.Request.HttpMethod, context.Request.Path));
}
///
/// Indicates whether an HttpNotImplementedHandler instance can be recycled and
/// used for another request.
///
public bool IsReusable {
get { return true; }
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
* Synchronous Http request handler interface
*
* Copyright (c) 1998 Microsoft Corporation
*/
namespace System.Web {
///
/// Provides a synchronous Http request handler interface.
///
internal class HttpNotFoundHandler : IHttpHandler {
internal HttpNotFoundHandler() {
}
///
/// Drives web processing execution.
///
public void ProcessRequest(HttpContext context) {
PerfCounters.IncrementCounter(AppPerfCounter.REQUESTS_NOT_FOUND);
throw new HttpException(404,
SR.GetString(SR.Path_not_found, context.Request.Path));
}
///
/// Indicates whether an HttpNotFoundHandler instance can be recycled and used
/// for another request.
///
public bool IsReusable {
get { return true; }
}
}
internal class HttpForbiddenHandler : IHttpHandler {
internal HttpForbiddenHandler() {
}
///
/// Drives web processing execution.
///
public void ProcessRequest(HttpContext context) {
PerfCounters.IncrementCounter(AppPerfCounter.REQUESTS_NOT_FOUND);
throw new HttpException(403,
SR.GetString(SR.Path_forbidden, context.Request.Path));
}
///
/// Indicates whether an HttpForbiddenHandler instance can be recycled and used
/// for another request.
///
public bool IsReusable {
get { return true; }
}
}
///
/// Provides a synchronous Http request handler interface.
///
internal class HttpMethodNotAllowedHandler : IHttpHandler {
internal HttpMethodNotAllowedHandler() {
}
///
/// Drives
/// web processing execution.
///
public void ProcessRequest(HttpContext context) {
throw new HttpException(405,
SR.GetString(SR.Path_forbidden, context.Request.HttpMethod));
}
///
/// Indicates whether an HttpForbiddenHandler instance can be recycled and used
/// for another request.
///
public bool IsReusable {
get { return true; }
}
}
///
/// Provides a synchronous Http request handler interface.
///
internal class HttpNotImplementedHandler : IHttpHandler {
internal HttpNotImplementedHandler() {
}
///
/// Drives web processing execution.
///
public void ProcessRequest(HttpContext context) {
throw new HttpException(501,
SR.GetString(SR.Method_for_path_not_implemented, context.Request.HttpMethod, context.Request.Path));
}
///
/// Indicates whether an HttpNotImplementedHandler instance can be recycled and
/// used for another request.
///
public bool IsReusable {
get { return true; }
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CompleteWizardStep.cs
- MouseButton.cs
- PortCache.cs
- CodeDefaultValueExpression.cs
- SettingsProperty.cs
- ExceptionRoutedEventArgs.cs
- DataComponentNameHandler.cs
- WebZone.cs
- BrowserDefinition.cs
- XmlDocumentType.cs
- WebPartTransformerCollection.cs
- _ProxyRegBlob.cs
- ControlPropertyNameConverter.cs
- Connector.cs
- RemoteWebConfigurationHostStream.cs
- AsyncContentLoadedEventArgs.cs
- DrawingVisualDrawingContext.cs
- HostExecutionContextManager.cs
- SoapFormatter.cs
- EdmSchemaError.cs
- XPathScanner.cs
- safex509handles.cs
- ViewBox.cs
- DataGridViewCheckBoxCell.cs
- ValidationContext.cs
- UriScheme.cs
- DataGridViewUtilities.cs
- MustUnderstandBehavior.cs
- ElementProxy.cs
- WindowsFormsHelpers.cs
- Base64Encoder.cs
- SiteMapDataSource.cs
- PeerInvitationResponse.cs
- SerializationSectionGroup.cs
- DataGridTemplateColumn.cs
- WebPartDisplayModeCollection.cs
- FieldTemplateFactory.cs
- Attributes.cs
- ServiceNotStartedException.cs
- SqlNotificationRequest.cs
- BulletChrome.cs
- ResourceSet.cs
- PermissionToken.cs
- ToolboxItemWrapper.cs
- Main.cs
- PointLightBase.cs
- ExceptionHandlers.cs
- Control.cs
- QuaternionAnimationBase.cs
- ConnectionStringSettingsCollection.cs
- GiveFeedbackEventArgs.cs
- XPathScanner.cs
- PrivilegeNotHeldException.cs
- Matrix3DStack.cs
- HttpResponseInternalWrapper.cs
- errorpatternmatcher.cs
- NamespaceQuery.cs
- InkSerializer.cs
- FixedPageStructure.cs
- UriTemplateCompoundPathSegment.cs
- ListBoxItem.cs
- XXXInfos.cs
- SequenceFullException.cs
- FileDialogPermission.cs
- InternalConfigHost.cs
- ActivitySurrogateSelector.cs
- Slider.cs
- ChannelListenerBase.cs
- IISMapPath.cs
- EventDescriptorCollection.cs
- Guid.cs
- AjaxFrameworkAssemblyAttribute.cs
- DropShadowBitmapEffect.cs
- FlowDocumentPage.cs
- TrimSurroundingWhitespaceAttribute.cs
- TimeoutException.cs
- SliderAutomationPeer.cs
- translator.cs
- PropertyMetadata.cs
- StoreContentChangedEventArgs.cs
- OptimalTextSource.cs
- NamespaceEmitter.cs
- RowCache.cs
- Gdiplus.cs
- SQLGuidStorage.cs
- pingexception.cs
- TypeUtils.cs
- HMACMD5.cs
- IPEndPoint.cs
- Italic.cs
- TextCharacters.cs
- CounterCreationDataConverter.cs
- DynamicRenderer.cs
- UnconditionalPolicy.cs
- PropertiesTab.cs
- XmlCodeExporter.cs
- WindowsStreamSecurityUpgradeProvider.cs
- JsonWriterDelegator.cs
- DataTableMappingCollection.cs
- StorageComplexPropertyMapping.cs