Aracılığıyla paylaş


FileWebRequest.Method Özellik

Tanım

İstek için kullanılan protokol yöntemini alır veya ayarlar. Bu özellik gelecekte kullanılmak üzere ayrılmıştır.

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

Özellik Değeri

Bu istekte kullanılacak protokol yöntemi.

Özel durumlar

Yöntem geçersiz.

-veya-

yöntemi desteklenmiyor.

-veya-

Birden çok yöntem belirtildi.

Örnekler

Aşağıdaki kod örneği, istek için kullanılan protokol yöntemini ayarlar. sınıfındaki tam örne FileWebRequest bakın.

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

Açıklamalar

Method özelliği şu anda sınıfı tarafından kullanılmamaktadırFileWebRequest.

Şunlara uygulanır