我在哪里设置的CookieContainer的服务引用? [英] Where do I set the CookieContainer on a Service Reference?
本文介绍了我在哪里设置的CookieContainer的服务引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在添加WebService的参考ASMX服务在.NET 2.0的项目,例如,
When adding WebService Reference to an ASMX Service on a .NET 2.0 project for example,
var objService = new NameSpace.groupservices();
存在,
there exists,
objService.CookieContainer = new System.Net.CookieContainer();
当在例如.NET 4.0的项目添加到服务引用ASMX服务,
When adding ServiceReference to an ASMX Service on a .NET 4.0 project for example,
var objService = new NameSpace.groupservicesSoapClient();
也没有任何的CookieContainer属性objService
there isn't any CookieContainer property for objService
有一个类似的问题被问这里没有正解。
A similar question was asked here with no positive solution.
可能有人请引导到哪里找物业?
Could someone please guide where to find the property?
推荐答案
打开您的应用。配置文件,并添加 allowCookies =真正的以结合
Open your app.config file and add allowCookies="true" to the binding.
事情是这样的:
<binding allowCookies="true" />
这篇关于我在哪里设置的CookieContainer的服务引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文