//Controller code
CookieContainer cookieContainer = new CookieContainer();
//makes new cookie here
cookieContainer.Add(myCookie);
//Service/Facade code
//myCookie gets passed here
如何将Cookie从容器中取出以确保它是正确的Cookie?
答案 0 :(得分:1)
假设您尝试将Cookie与Web服务一起使用,请查看此Microsoft支持文章:
HOW TO: Use CookieContainer to Maintain a State in Web Services When You Use Visual C# .NET