Freigeben über


FileWebRequest.Method Eigenschaft

Definition

Ruft die für die Anforderung verwendete Protokollmethode ab oder legt sie fest. Diese Eigenschaft ist für die zukünftige Verwendung reserviert.

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

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 für die Anforderung verwendete Protokollmethode festgelegt. Verweisen Sie auf das vollständige Beispiel in der FileWebRequest Klasse.

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