次の方法で共有


FileWebRequest.Method プロパティ

要求に使用するプロトコル メソッドを取得または設定します。このプロパティは、今後使用するために予約されています。

Overrides Public Property Method As String
[C#]
public override string Method {get; set;}
[C++]
public: __property String* get_Method();public: __property void set_Method(String*);
[JScript]
public override function get Method() : String;public override function set Method(String);

プロパティ値

要求で使用するプロトコル メソッド。

解説

Method プロパティは、現在 FileWebRequest クラスでは使用されていません。

使用例

[Visual Basic, C#, C++] 要求に使用するプロトコル メソッドを設定する例を次に示します。詳細については、 FileWebRequest クラスのトピックを参照してください。

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


[C#] 
// 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";

[C++] 
// Create a Uri object.
Uri* myUrl = new Uri(String::Format(S"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=S"POST";

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

FileWebRequest クラス | FileWebRequest メンバ | System.Net 名前空間