Export (0) Print
Expand All

BrowserInformation.CookiesEnabled Property

Silverlight

Gets a value that indicates whether the browser supports cookies.

Namespace:  System.Windows.Browser
Assembly:  System.Windows.Browser (in System.Windows.Browser.dll)

public bool CookiesEnabled { get; }

Property Value

Type: System.Boolean
true if the browser supports cookies; otherwise, false.

This property corresponds to the browser's Navigator.cookieEnabled property.

The following example demonstrates how to use the BrowserInformation class.


using System;
using System.Windows.Controls;
using System.Windows.Browser;

public class Example
{
   public static void Demo(System.Windows.Controls.TextBlock outputBlock)
   {
     outputBlock.Text +=
       "\nSilverlight can provide browser information:\n" +
       "\nBrowser Name = " + HtmlPage.BrowserInformation.Name +
       "\nBrowser Version = " + HtmlPage.BrowserInformation.BrowserVersion.ToString() +
       "\nUserAgent = " + HtmlPage.BrowserInformation.UserAgent +
       "\nPlatform = " + HtmlPage.BrowserInformation.Platform +
       "\nCookiesEnabled = " + HtmlPage.BrowserInformation.CookiesEnabled.ToString() +
       "\nProductName = " + HtmlPage.BrowserInformation.ProductName.ToString() +
       "\nProductVersion = " + HtmlPage.BrowserInformation.ProductVersion.ToString();
   }
}


Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2015 Microsoft