FileWebRequest.Method Egenskap

Definition

Hämtar eller anger den protokollmetod som används för begäran. Den här egenskapen är reserverad för framtida användning.

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

Egenskapsvärde

Den protokollmetod som ska användas i den här begäran.

Undantag

Metoden är ogiltig.

-eller-

Metoden stöds inte.

-eller-

Flera metoder har angetts.

Exempel

I följande kodexempel anges den protokollmetod som används för begäran. Se det fullständiga exemplet i FileWebRequest klassen.

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

Kommentarer

Egenskapen Method används för närvarande inte av FileWebRequest klassen.

Gäller för