NSHttpCookie.CookieFromProperties(NSDictionary) 方法

定义

用于创建 Cookie 的工厂方法。

[Foundation.Export("cookieWithProperties:")]
public static Foundation.NSHttpCookie CookieFromProperties (Foundation.NSDictionary properties);
static member CookieFromProperties : Foundation.NSDictionary -> Foundation.NSHttpCookie

参数

properties
NSDictionary

包含 Cookie 值的字典。

返回

属性

注解

若要实例化 NSHTTPCookie 的实例,需要传递 NSDictionary

实际密钥必须是此类中KeyName (、、 KeyOriginUrlKeyCommentUrlKeyCommentKeyDiscardKeyMaximumAgeKeyValueKeyDomainKeyPortKeyVersionKeyPathKeySecureKeyExpires) 的公共密钥静态字段之一。


var properties = NSDictionary.FromObjectsAndKeys (new object [] { "MyCookieValue" }, new object [] { NSHttpCookie.KeyValue });
var cookie = new NSHttpCookie (properties);

适用于