FileWebRequest.Method 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定要求所使用的通訊協定 (Protocol) 方法。 這個屬性保留給未來的版本使用。
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 屬性。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應