IOException 클래스

정의

I/O 오류가 발생하는 경우에 throw되는 예외입니다.

public ref class IOException : Exception
public ref class IOException : SystemException
public class IOException : Exception
public class IOException : SystemException
[System.Serializable]
public class IOException : SystemException
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class IOException : SystemException
type IOException = class
    inherit Exception
type IOException = class
    inherit SystemException
[<System.Serializable>]
type IOException = class
    inherit SystemException
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type IOException = class
    inherit SystemException
Public Class IOException
Inherits Exception
Public Class IOException
Inherits SystemException
상속
IOException
상속
파생
특성

예제

이 코드 예제는에 대해 제공 된 큰 예제의 일부는 FileStream.Lock 메서드.

// Catch the IOException generated if the 
// specified part of the file is locked.
catch ( IOException^ e ) 
{
   Console::WriteLine( "{0}: The write operation could not "
   "be performed because the specified "
   "part of the file is locked.", e->GetType()->Name );
}
// Catch the IOException generated if the
// specified part of the file is locked.
catch(IOException e)
{
    Console.WriteLine(
        "{0}: The write operation could not " +
        "be performed because the specified " +
        "part of the file is locked.",
        e.GetType().Name);
}
' Catch the IOException generated if the 
' specified part of the file is locked.
Catch ex As IOException
    Console.WriteLine( _
        "{0}: The write operation could " & _
        "not be performed because the " & _
        "specified part of the file is " & _
        "locked.", ex.GetType().Name)
End Try

설명

IOException 는 스트림, 파일 및 디렉터리를 사용하여 정보에 액세스하는 동안 throw된 예외에 대한 기본 클래스입니다.

기본 클래스 라이브러리에는 다음 형식이 포함되며, 각 형식은 의 IOException 파생 클래스입니다.

적절한 경우 IOException 대신 이러한 형식을 사용합니다.

IOException 는 값이 0x80131620 HRESULT COR_E_IO 사용합니다.

생성자

IOException()

메시지 문자열을 빈 문자열("")로 설정하고, HRESULT를 COR_E_IO로 설정하고, 내부 예외를 null 참조로 설정하여 IOException 의 새 인스턴스를 초기화합니다.

IOException(SerializationInfo, StreamingContext)
사용되지 않음.

지정한 직렬화 및 컨텍스트 정보를 사용하여 IOException 클래스의 새 인스턴스를 초기화합니다.

IOException(String)

message로 설정된 메시지 문자열, COR_E_IO로 설정된 HRESULT 및 null로 설정된 내부 예외를 사용하여 IOException 클래스의 새 인스턴스를 초기화합니다.

IOException(String, Exception)

지정된 오류 메시지와 해당 예외의 원인인 내부 예외에 대한 참조를 사용하여 IOException 클래스의 새 인스턴스를 초기화합니다.

IOException(String, Int32)

message로 설정된 메시지 문자열과 사용자 정의된 HRESULT를 사용하여 IOException 클래스의 새 인스턴스를 초기화합니다.

속성

Data

예외에 대한 사용자 정의 정보를 추가로 제공하는 키/값 쌍 컬렉션을 가져옵니다.

(다음에서 상속됨 Exception)
HelpLink

이 예외와 연결된 도움말 파일에 대한 링크를 가져오거나 설정합니다.

(다음에서 상속됨 Exception)
HResult

특정 예외에 할당된 코드화된 숫자 값인 HRESULT를 가져오거나 설정합니다.

(다음에서 상속됨 Exception)
InnerException

현재 예외를 발생시킨 Exception 인스턴스를 가져옵니다.

(다음에서 상속됨 Exception)
Message

현재 예외를 설명하는 메시지를 가져옵니다.

(다음에서 상속됨 Exception)
Source

오류를 발생시키는 애플리케이션 또는 개체의 이름을 가져오거나 설정합니다.

(다음에서 상속됨 Exception)
StackTrace

호출 스택의 직접 실행 프레임 문자열 표현을 가져옵니다.

(다음에서 상속됨 Exception)
TargetSite

현재 예외를 throw하는 메서드를 가져옵니다.

(다음에서 상속됨 Exception)

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetBaseException()

파생 클래스에서 재정의된 경우 하나 이상의 후속 예외의 근본 원인이 되는 Exception 을 반환합니다.

(다음에서 상속됨 Exception)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetObjectData(SerializationInfo, StreamingContext)
사용되지 않음.

파생 클래스에서 재정의된 경우 예외에 관한 정보를 SerializationInfo 에 설정합니다.

(다음에서 상속됨 Exception)
GetType()

현재 인스턴스의 런타임 형식을 가져옵니다.

(다음에서 상속됨 Exception)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 예외에 대한 문자열 표현을 만들고 반환합니다.

(다음에서 상속됨 Exception)

이벤트

SerializeObjectState
사용되지 않음.

예외에 대한 serialize된 데이터가 들어 있는 예외 상태 개체가 만들어지도록 예외가 serialize될 때 발생합니다.

(다음에서 상속됨 Exception)

적용 대상

추가 정보