FileWebRequest.Method FileWebRequest.Method FileWebRequest.Method FileWebRequest.Method Property

Definición

Obtiene o establece el método de protocolo utilizado para realizar la solicitud.Gets or sets the protocol method used for the request. Esta propiedad está reservada para un 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 de propiedad

Método de protocolo que se utilizará en esta solicitud.The protocol method to use in this request.

Excepciones

El método no es válido.The method is invalid.

o bien-or-

El método no se admite.The method is not supported.

o bien-or-

Se especificaron varios métodos.Multiple methods were specified.

Ejemplos

En el ejemplo de código siguiente se establece el método de protocolo utilizado para la solicitud.The following code example sets the protocol method used for the request. Consulte el ejemplo completo en la FileWebRequest clase.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"

Comentarios

La Method FileWebRequest clase no usa actualmente la propiedad.The Method property is currently not used by the FileWebRequest class.

Se aplica a