PathTooLongException PathTooLongException PathTooLongException PathTooLongException Constructors

定義

多載

PathTooLongException() PathTooLongException() PathTooLongException()

使用其 HRESULT 設定為 COR_E_PATHTOOLONG,初始化 PathTooLongException 類別的新執行個體。Initializes a new instance of the PathTooLongException class with its HRESULT set to COR_E_PATHTOOLONG.

PathTooLongException(String) PathTooLongException(String) PathTooLongException(String) PathTooLongException(String)

使用其訊息字串設定為 message 和其 HRESULT 設定為 COR_E_PATHTOOLONG,初始化 PathTooLongException 類別的新執行個體。Initializes a new instance of the PathTooLongException class with its message string set to message and its HRESULT set to COR_E_PATHTOOLONG.

PathTooLongException(SerializationInfo, StreamingContext) PathTooLongException(SerializationInfo, StreamingContext) PathTooLongException(SerializationInfo, StreamingContext) PathTooLongException(SerializationInfo, StreamingContext)

使用指定的序列化 (Serialization) 和內容資訊,初始化 PathTooLongException 類別的新執行個體。Initializes a new instance of the PathTooLongException class with the specified serialization and context information.

PathTooLongException(String, Exception) PathTooLongException(String, Exception) PathTooLongException(String, Exception) PathTooLongException(String, Exception)

使用指定的錯誤訊息以及造成此例外狀況的內部例外狀況的參考,初始化 PathTooLongException 類別的新執行個體。Initializes a new instance of the PathTooLongException class with a specified error message and a reference to the inner exception that is the cause of this exception.

PathTooLongException() PathTooLongException() PathTooLongException()

使用其 HRESULT 設定為 COR_E_PATHTOOLONG,初始化 PathTooLongException 類別的新執行個體。Initializes a new instance of the PathTooLongException class with its HRESULT set to COR_E_PATHTOOLONG.

public:
 PathTooLongException();
public PathTooLongException ();
Public Sub New ()

備註

這個建構函式初始化Message屬性的新執行個體的系統提供的訊息,描述錯誤,例如 「 提供的路徑太長。 」This constructor initializes the Message property of the new instance to a system-supplied message that describes the error, such as "The supplied path is too long." 此訊息會考量目前的系統文化特性。This message takes into account the current system culture.

另請參閱

PathTooLongException(String) PathTooLongException(String) PathTooLongException(String) PathTooLongException(String)

使用其訊息字串設定為 message 和其 HRESULT 設定為 COR_E_PATHTOOLONG,初始化 PathTooLongException 類別的新執行個體。Initializes a new instance of the PathTooLongException class with its message string set to message and its HRESULT set to COR_E_PATHTOOLONG.

public:
 PathTooLongException(System::String ^ message);
public PathTooLongException (string message);
new System.IO.PathTooLongException : string -> System.IO.PathTooLongException
Public Sub New (message As String)

參數

message
String String String String

描述錯誤的 StringA String that describes the error. message 的內容必須能讓人了解。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.

備註

這個建構函式初始化Message屬性的新執行個體使用messageThis constructor initializes the Message property of the new instance using message.

另請參閱

PathTooLongException(SerializationInfo, StreamingContext) PathTooLongException(SerializationInfo, StreamingContext) PathTooLongException(SerializationInfo, StreamingContext) PathTooLongException(SerializationInfo, StreamingContext)

使用指定的序列化 (Serialization) 和內容資訊,初始化 PathTooLongException 類別的新執行個體。Initializes a new instance of the PathTooLongException class with the specified serialization and context information.

protected:
 PathTooLongException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected PathTooLongException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.IO.PathTooLongException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.IO.PathTooLongException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

參數

info
SerializationInfo SerializationInfo SerializationInfo SerializationInfo

SerializationInfo,包含所擲回之例外狀況的相關序列化物件資料。The SerializationInfo that holds the serialized object data about the exception being thrown.

context
StreamingContext StreamingContext StreamingContext StreamingContext

包含有關來源或目的端內容資訊的 StreamingContextThe StreamingContext that contains contextual information about the source or destination.

另請參閱

PathTooLongException(String, Exception) PathTooLongException(String, Exception) PathTooLongException(String, Exception) PathTooLongException(String, Exception)

使用指定的錯誤訊息以及造成此例外狀況的內部例外狀況的參考,初始化 PathTooLongException 類別的新執行個體。Initializes a new instance of the PathTooLongException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public:
 PathTooLongException(System::String ^ message, Exception ^ innerException);
public PathTooLongException (string message, Exception innerException);
new System.IO.PathTooLongException : string * Exception -> System.IO.PathTooLongException
Public Sub New (message As String, innerException As Exception)

參數

message
String String String String

描述錯誤的 StringA String that describes the error. message 的內容必須能讓人了解。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.

innerException
Exception Exception Exception Exception

做為目前例外狀況發生原因的例外狀況。The exception that is the cause of the current exception. 如果 innerException 參數不是 null,則目前的例外狀況會在處理內部例外的 catch 區塊中引發。If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception.

備註

被擲回以做為前一個例外狀況直接結果的例外狀況,應該在 InnerException 屬性中包含對前一個例外狀況的參考。An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. InnerException 屬性會傳回與傳入建構函式中相同的值;如果 null 屬性沒有提供內部例外值給建構函式,則傳回 InnerExceptionThe InnerException property returns the same value that is passed into the constructor, or null if the InnerException property does not supply the inner exception value to the constructor.

下表顯示 PathTooLongException 執行個體的初始屬性值。The following table shows the initial property values for an instance of PathTooLongException.

屬性Property Value
InnerException 內部例外狀況參考。The inner exception reference.
Message 錯誤訊息字串。The error message string.

如需有關內部例外狀況的詳細資訊,請參閱InnerExceptionFor more information on inner exceptions, see InnerException.

另請參閱

適用於