Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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; }
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ServerType.cs
- StrokeNodeData.cs
- RowsCopiedEventArgs.cs
- BamlBinaryReader.cs
- WaveHeader.cs
- SafePEFileHandle.cs
- ToolStripOverflowButton.cs
- CompilerParameters.cs
- MetadataItem.cs
- Hex.cs
- Int16AnimationBase.cs
- TrackingServices.cs
- DefinitionBase.cs
- ListBoxDesigner.cs
- RuntimeResourceSet.cs
- GridViewRow.cs
- XmlDeclaration.cs
- ImageFormat.cs
- XmlFormatWriterGenerator.cs
- BitmapPalette.cs
- OrthographicCamera.cs
- DiscoveryClientDuplexChannel.cs
- BinaryObjectWriter.cs
- PersonalizableAttribute.cs
- base64Transforms.cs
- TextSchema.cs
- FilteredXmlReader.cs
- TypeDescriptorContext.cs
- ApplicationManager.cs
- SortDescriptionCollection.cs
- DesignSurfaceManager.cs
- LocalFileSettingsProvider.cs
- OdbcConnectionOpen.cs
- ProfileEventArgs.cs
- CustomErrorCollection.cs
- UIElement3DAutomationPeer.cs
- XmlNamespaceDeclarationsAttribute.cs
- LinqDataSource.cs
- handlecollector.cs
- DbConnectionPoolGroup.cs
- ArrayHelper.cs
- AutomationIdentifier.cs
- WebWorkflowRole.cs
- ThemeInfoAttribute.cs
- DesignerView.cs
- NavigationPropertyEmitter.cs
- ArrangedElement.cs
- AlphabetConverter.cs
- ProfileProvider.cs
- DBConcurrencyException.cs
- FixedNode.cs
- TdsParserHelperClasses.cs
- TcpClientSocketManager.cs
- SQLSingleStorage.cs
- PlanCompiler.cs
- DrawingImage.cs
- ValidationEventArgs.cs
- CreateRefExpr.cs
- NullableConverter.cs
- CodeMemberField.cs
- TextEditorCharacters.cs
- TreeWalker.cs
- StringValueConverter.cs
- UnmanagedBitmapWrapper.cs
- AncestorChangedEventArgs.cs
- FixedSOMTable.cs
- DataBindingList.cs
- ExpressionConverter.cs
- RegexReplacement.cs
- NameObjectCollectionBase.cs
- SymLanguageVendor.cs
- assemblycache.cs
- ResourceReader.cs
- NavigatorOutput.cs
- FormatSettings.cs
- XPathItem.cs
- CacheEntry.cs
- FontSourceCollection.cs
- PropertyItem.cs
- InputBuffer.cs
- CultureInfoConverter.cs
- AxisAngleRotation3D.cs
- DataGridViewComboBoxColumn.cs
- objectresult_tresulttype.cs
- ObjectCacheHost.cs
- LinqDataSourceHelper.cs
- BindingBase.cs
- UriTemplateDispatchFormatter.cs
- EntityClassGenerator.cs
- Floater.cs
- VBIdentifierTrimConverter.cs
- HostedAspNetEnvironment.cs
- IsolatedStorageException.cs
- ToolStripLabel.cs
- TdsParserStaticMethods.cs
- DetailsViewPagerRow.cs
- SemanticResolver.cs
- ObjectDataSourceSelectingEventArgs.cs
- ThrowHelper.cs
- RenderingBiasValidation.cs