FileWebRequest.Method Właściwość

Definicja

Pobiera lub ustawia metodę protokołu używaną dla żądania. Ta właściwość jest zarezerwowana do użytku w przyszłości.

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

Wartość właściwości

Metoda protokołu używana w tym żądaniu.

Wyjątki

Metoda jest nieprawidłowa.

-lub-

Metoda nie jest obsługiwana.

-lub-

Określono wiele metod.

Przykłady

Poniższy przykład kodu ustawia metodę protokołu używaną dla żądania. Zapoznaj się z kompletnym FileWebRequest przykładem w klasie.

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

Uwagi

Właściwość Method nie jest obecnie używana przez klasę FileWebRequest .

Dotyczy