FileWebRequest.Method Eigenschaft

Definition

Ruft die für die Anforderung verwendete Protokollmethode ab, oder legt diese fest. Diese Eigenschaft ist für eine spätere Verwendung vorgesehen.

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

Eigenschaftswert

String

Die in dieser Anforderung zu verwendende Protokollmethode.

Ausnahmen

Die Methode ist ungültig.

- oder -

Die Methode wird nicht unterstützt.

- oder -

Es wurden mehrere Methoden angegeben.

Beispiele

Im folgenden Codebeispiel wird die Protokollmethode festgelegt, die für die Anforderung verwendet wird. Verweisen Sie auf das vollständige Beispiel in der FileWebRequest Klasse.

// 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"

Hinweise

Die Method Eigenschaft wird derzeit nicht von der FileWebRequest Klasse verwendet.

Gilt für