文章分类 -  C#基础

一个人能力的好坏
使用HttpWebRequest访问多个页面实现用同一Session
摘要:代码是很久很久以前写的了....现在把它放出来..string url = "http://localhost:2677/WebSite3/Default2.aspx"; HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); req.CookieContainer = new CookieContainer(); string s = "loginuser=1&password=1&logintype=%C1%AC%CF%DF%B9%FA%BC%CA&domainid=1& 阅读全文
posted @ 2011-03-04 17:30 [RJ] 阅读(3448) 评论(0) 推荐(0)
SSL/TLS 安全通道建立
摘要:在很多的业务需求中都可能会用到其他网站的数据..当遇到SSL(https)加密的页面时将会报错...我们可以用个小方法解决:先加入下面的方法 private bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; } 然后只需在访问SSL(https)加密的页面时在其方法前加上如下 ServicePointManager.ServerCertificateValidatio 阅读全文
posted @ 2011-03-04 17:20 [RJ] 阅读(1017) 评论(1) 推荐(0)