Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / xsp / System / Web / HTTPNotFoundHandler.cs / 1 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NameObjectCollectionBase.cs
- DbgUtil.cs
- SqlConnection.cs
- AudienceUriMode.cs
- WsdlServiceChannelBuilder.cs
- DateTimeConverter.cs
- LinkedResource.cs
- InvalidComObjectException.cs
- StyleBamlTreeBuilder.cs
- OracleRowUpdatingEventArgs.cs
- ObservableCollection.cs
- SizeChangedInfo.cs
- ChangePasswordDesigner.cs
- EntityModelBuildProvider.cs
- XmlTextReaderImpl.cs
- BinaryKeyIdentifierClause.cs
- DispatcherExceptionEventArgs.cs
- GZipDecoder.cs
- DiagnosticTrace.cs
- Command.cs
- WindowsFont.cs
- ObjectHelper.cs
- TextServicesPropertyRanges.cs
- TransactionScopeDesigner.cs
- OledbConnectionStringbuilder.cs
- XmlNamedNodeMap.cs
- basenumberconverter.cs
- DatagridviewDisplayedBandsData.cs
- ExecutedRoutedEventArgs.cs
- HwndSubclass.cs
- AudioException.cs
- SessionStateUtil.cs
- WaitForChangedResult.cs
- GroupBoxRenderer.cs
- ObjectStateManager.cs
- BoundColumn.cs
- DefinitionBase.cs
- TagPrefixAttribute.cs
- DocumentScope.cs
- WebPartConnectionsConfigureVerb.cs
- XmlTextReaderImplHelpers.cs
- ByteKeyFrameCollection.cs
- UserNamePasswordValidator.cs
- ContextMenuAutomationPeer.cs
- DesignerAttribute.cs
- LogicalExpr.cs
- ColorTypeConverter.cs
- UpdateCommand.cs
- ConfigurationElementCollection.cs
- HtmlUtf8RawTextWriter.cs
- SecurityProtocolCorrelationState.cs
- WebPartCollection.cs
- InputLanguageSource.cs
- ListSurrogate.cs
- streamingZipPartStream.cs
- IgnoreFlushAndCloseStream.cs
- ToolStripContextMenu.cs
- SpellCheck.cs
- SHA384Cng.cs
- DataSpaceManager.cs
- VisualProxy.cs
- TemplateKey.cs
- WebPartConnectVerb.cs
- SelectionRangeConverter.cs
- bidPrivateBase.cs
- Point3DAnimationUsingKeyFrames.cs
- UnsafeNativeMethods.cs
- LiteralTextParser.cs
- CategoriesDocumentFormatter.cs
- FileDetails.cs
- StyleBamlTreeBuilder.cs
- TextDecorationUnitValidation.cs
- Marshal.cs
- WorkflowOperationFault.cs
- TlsnegoTokenAuthenticator.cs
- WindowsAltTab.cs
- WmlPanelAdapter.cs
- BuildProviderCollection.cs
- AttributeEmitter.cs
- DataShape.cs
- VectorCollectionConverter.cs
- ContainerUtilities.cs
- EmissiveMaterial.cs
- MatrixKeyFrameCollection.cs
- Int64KeyFrameCollection.cs
- handlecollector.cs
- ZipIOLocalFileDataDescriptor.cs
- ValidationHelper.cs
- TypedTableHandler.cs
- HtmlControlPersistable.cs
- SwitchExpression.cs
- WebPartDisplayModeCancelEventArgs.cs
- GridViewItemAutomationPeer.cs
- VBCodeProvider.cs
- BitmapImage.cs
- TimelineGroup.cs
- ClonableStack.cs
- NavigationProgressEventArgs.cs
- ServiceHttpModule.cs
- StreamGeometryContext.cs