public class ProtocolViolationException : InvalidOperationException
Object
Exception
SystemException
InvalidOperationException
ProtocolViolationException
System
Networking
Represents errors that occur due to violating the rules of a network protocol.
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.
System.Net Namespace
ProtocolViolationException Constructors
ProtocolViolationException() Constructor
ProtocolViolationException(System.String) Constructor
public ProtocolViolationException();
Constructs and initializes a new instance of the ProtocolViolationException class.
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
.
System.Net.ProtocolViolationException Class, System.Net Namespace
public ProtocolViolationException(string message);
Constructs and initializes a new instance of the ProtocolViolationException class.
- 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.
This constructor initializes the System.Net.ProtocolViolationException.Message property of the new instance using message. If message isnull
, 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
.
System.Net.ProtocolViolationException Class, System.Net Namespace