FileWebRequest.Method 속성

정의

요청하는 데 사용되는 프로토콜 메서드를 가져오거나 설정합니다. 이 속성은 나중에 사용할 수 있도록 예약됩니다.

public:
 virtual property System::String ^ Method { System::String ^ get(); void set(System::String ^ value); };
public override string Method { get; set; }
member this.Method : string with get, set
Public Overrides Property Method As String

속성 값

String

이 요청에서 사용할 프로토콜 메서드입니다.

예외

메서드가 잘못된 경우

또는

메서드가 지원되지 않습니다.

또는

여러 메서드가 지정된 경우

예제

다음 코드 예제에서는 요청에 사용되는 프로토콜 메서드를 설정합니다. 클래스의 전체 예제를 FileWebRequest 참조하세요.

// Create a Uri object.
Uri^ myUrl = gcnew Uri( String::Format( "file://{0}", fileName ) );

// Create a FileWebRequest object.
myFileWebRequest = dynamic_cast<FileWebRequest^>(WebRequest::CreateDefault( myUrl ));

// Set the timeout to the value selected by the user.
myFileWebRequest->Timeout = timeout;

// Set the Method property to POST
myFileWebRequest->Method = "POST";
// Create a Uri object.
Uri myUrl = new Uri ("file://" + fileName);

// Create a FileWebRequest object.
myFileWebRequest = (FileWebRequest)WebRequest.CreateDefault (myUrl);

// Set the time-out to the value selected by the user.
myFileWebRequest.Timeout = timeout;

// Set the Method property to POST
myFileWebRequest.Method = "POST";
' Create a Uri object.to access the file requested by the user. 
Dim myUrl As New Uri("file://" + fileName)

' Create a FileWebRequest object.for the requeste file.
myFileWebRequest = CType(WebRequest.CreateDefault(myUrl), FileWebRequest)

' Set the time-out to the value selected by the user.
myFileWebRequest.Timeout = timeout

' Set the Method property to POST  
myFileWebRequest.Method = "POST"

설명

Method 속성은 현재 클래스에서 FileWebRequest 사용되지 않습니다.

적용 대상