FileWebRequest.Method Свойство

Определение

Возвращает или задает метод протокола, используемый для запроса. Это свойство зарезервировано для дальнейшего использования.

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

Значение свойства

Метод протокола для использования в данном запросе.

Исключения

Метод является недопустимым.

-или-

Метод не поддерживается.

-или-

Было указано несколько методов.

Примеры

В следующем примере кода задается метод протокола, используемый для запроса. См. полный пример в FileWebRequest классе .

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

Комментарии

В Method настоящее время свойство не используется классом FileWebRequest .

Применяется к