HttpRequestCachePolicy.ToString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a string representation of this instance.
public:
override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
Returns
A String value that contains the property values for this instance.
Examples
The following code example demonstrates calling this method.
static WebResponse^ GetResponseUsingDefaultCache( Uri^ uri )
{
// Set a cache policy level for the "http:" scheme.
HttpRequestCachePolicy^ policy = gcnew HttpRequestCachePolicy( HttpRequestCacheLevel::Default );
// Create the request.
WebRequest^ request = WebRequest::Create( uri );
request->CachePolicy = policy;
WebResponse^ response = request->GetResponse();
Console::WriteLine( L"Policy {0}.", policy );
Console::WriteLine( L"Is the response from the cache? {0}", response->IsFromCache );
return response;
}
public static WebResponse GetResponseUsingDefaultCache(Uri uri)
{
// Set a cache policy level for the "http:" scheme.
HttpRequestCachePolicy policy = new HttpRequestCachePolicy(HttpRequestCacheLevel.Default);
// Create the request.
WebRequest request = WebRequest.Create(uri);
request.CachePolicy = policy;
WebResponse response = request.GetResponse();
Console.WriteLine("Policy {0}.", policy.ToString());
Console.WriteLine("Is the response from the cache? {0}", response.IsFromCache);
return response;
}
Remarks
The string contains a label that identifies the property, followed by a colon (":") and the value. Properties are separated by a single space.
Applies to
GitHub पर हमारे साथ सहयोग करें
इस सामग्री का स्रोत GitHub पर पाया जा सकता है, जहाँ आप समस्याएँ बना और समीक्षा भी कर सकते हैं और अनुरोध खींच सकते हैं. अधिक जानकारी के लिए, हमारे योगदानकर्ता गाइड देखें.