本文整理汇总了C#中Cookie.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Cookie.ToString方法的具体用法?C# Cookie.ToString怎么用?C# Cookie.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cookie
的用法示例。
在下文中一共展示了Cookie.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteCookieNamed
public void DeleteCookieNamed(String name)
{
// TODO(andre.nogueira): Work not completed, still not working
Cookie cookieToDelete = new Cookie(name, "", ""/*GetCurrentHost()*/, "/");
String c = cookieToDelete.ToString();
DeleteCookie(cookieToDelete);
}
示例2: ToString_Compare_Success
public static void ToString_Compare_Success()
{
Cookie c = new Cookie();
Assert.Equal(string.Empty, c.ToString());
c = new Cookie("name", "value");
Assert.Equal("name=value", c.ToString());
c = new Cookie("name", "value", "path", "domain");
c.Port = "\"80\"";
c.Version = 100;
Assert.Equal("$Version=100; name=value; $Path=path; $Domain=domain; $Port=\"80\"", c.ToString());
c.Version = 0;
Assert.Equal("name=value; $Path=path; $Domain=domain; $Port=\"80\"", c.ToString());
c.Port = "";
Assert.Equal("name=value; $Path=path; $Domain=domain; $Port", c.ToString());
}
示例3: AddCookie
public void AddCookie(Cookie cookie)
{
//TODO(andre.nogueira): check return value
int result;
String cookieString = cookie.ToString();
result = wdAddCookie(handle, cookieString);
}