干杯, - Joerg Jooss jo ********* @ gmx.net 包含一个uri,例如http://localhost/FirstProject/WebForm4.aspx" 我试图找出如何提取该字符串。我曾尝试过在cookie容器中获取内容 webRequest = WebRequest.Create(TARGET_URL)作为HttpWebRequest; webRequest .Method =" POST"; webRequest.ContentType =" application / x-www-form-urlencoded"; webRequest.CookieContainer = cookies; //将表单值写入请求消息中 StreamWriter requestWriter = new StreamWriter(webRequest.GetRequestStream()); requestWriter.Write(postData); requestWriter.Close(); //我们不需要内容响应,只是cookie它 发布 webRequest.GetResponse()。关闭(); System.Net。 CookieCollection myCookieColl = webRequest.CookieContainer.GetCookies(siteUri); 我可以在调试器中从myCookieColl获取cookie的值,但它是 被编码(例如t0m2qf55lelfzo55xsuxdi55)和myCookieColl没有暴露的 Item []属性,这使我能够通过 饼干,所以我现在卡住了。我无法弄清楚如何从该系列中获取一个 cookie,我无法弄清楚如何解码 值。 谢谢, James J. ***通过Developersdex发送 http://www.developersdex.com *** 不要只是参加USENET ......获得奖励!contains a uri such as "http://localhost/FirstProject/WebForm4.aspx"I am trying to figure out how to extract that string. I have tried toget something in a cookie containerwebRequest = WebRequest.Create(TARGET_URL) as HttpWebRequest;webRequest.Method = "POST";webRequest.ContentType = "application/x-www-form-urlencoded";webRequest.CookieContainer = cookies;// write the form values into the request messageStreamWriter requestWriter = newStreamWriter(webRequest.GetRequestStream());requestWriter.Write(postData);requestWriter.Close();// we don''t need the contents of the response, just the cookie itissueswebRequest.GetResponse().Close();System.Net.CookieCollection myCookieColl =webRequest.CookieContainer.GetCookies(siteUri);I can get a value for a cookie from myCookieColl in the debugger, but itis encoded (e.g. "t0m2qf55lelfzo55xsuxdi55") and there is no exposedItem[] property for myCookieColl that would enable me to step throughthe cookies, so I am stuck at present. I can''t figure out how to get acookie out of the collection and I can''t figure out how to decode theValue.Thanks,James J.*** Sent via Developersdex http://www.developersdex.com ***Don''t just participate in USENET...get rewarded for it! 这篇关于从WebRequest Cookie中提取字符串信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-20 23:14