FileWebRequest.Method Propriedade
Definição
Obtém ou define o método de protocolo usado para a solicitação.Gets or sets the protocol method used for the request. Esta propriedade está reservada para uso futuro.This property is reserved for future use.
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
Valor da propriedade
O método de protocolo a ser usado nesta solicitação.The protocol method to use in this request.
Exceções
O método é inválido.The method is invalid.
- ou --or-
O método não tem suporte.The method is not supported.
- ou --or-
Vários métodos foram especificados.Multiple methods were specified.
Exemplos
O exemplo de código a seguir define o método de protocolo usado para a solicitação.The following code example sets the protocol method used for the request. Consulte o exemplo completo na FileWebRequest classe.Refer to the complete example in the FileWebRequest class.
// 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"
Comentários
A Method propriedade não é usada atualmente pela FileWebRequest classe.The Method property is currently not used by the FileWebRequest class.