System.Net.ProtocolViolationException Class

public class ProtocolViolationException : InvalidOperationException

Base Types

Object
  Exception
    SystemException
      InvalidOperationException
        ProtocolViolationException

Assembly

System

Library

Networking

Summary

Represents errors that occur due to violating the rules of a network protocol.

Description

A ProtocolViolationException is thrown by types derived from WebRequest and WebResponse to indicate that an error has occurred as defined by the rules of the underlying protocol. For example, the HttpWebRequest type throws a ProtocolViolationException when an application attempts to send content without specifying the content length.

See Also

System.Net Namespace

Members

ProtocolViolationException Constructors

ProtocolViolationException() Constructor
ProtocolViolationException(System.String) Constructor


ProtocolViolationException() Constructor

public ProtocolViolationException();

Summary

Constructs and initializes a new instance of the ProtocolViolationException class.

Description

This constructor initializes the System.Net.ProtocolViolationException.Message property of the new instance to a system-supplied message that describes the error, such as "Protocol error occurred." This message takes into account the current system culture.

The System.Net.ProtocolViolationException.InnerException property of the new instance is initialized to null .

See Also

System.Net.ProtocolViolationException Class, System.Net Namespace

ProtocolViolationException(System.String) Constructor

public ProtocolViolationException(string message);

Summary

Constructs and initializes a new instance of the ProtocolViolationException class.

Parameters

message
A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

Description

This constructor initializes the System.Net.ProtocolViolationException.Message property of the new instance using message. If message is null , the System.Net.ProtocolViolationException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments.

The System.Net.ProtocolViolationException.InnerException property of the new instance is initialized to null .

See Also

System.Net.ProtocolViolationException Class, System.Net Namespace