11 2011 档案

HttpWebRequest 使用心得
摘要:1.post数据的时候,无论采集下来参数值从vs上看是不是编码状态,都一定要记得做 UrlEncode. =====在这方面吃了好几次亏。2.post xml 数据的时候,记得把content-type 修改为"text/xml",否则一使用CookieContainer必定 500错误。 阅读全文

posted @ 2011-11-21 17:45 飞舞的蒲公英

使用 WebBrowser 操作 js
摘要:winForm下的WebBrowser控件可以执行当前页面已存在的js,但不支持自定义js操作。因此要使用引用Microsoft.mshtml.dll来实现。该dll里面的接口各负责不同的工作。mshtml.IHTMLWindow2 可负责js操作。 mshtml.IHTMLDocument2 currentDoc = (mshtml.IHTMLDocument2)webBrowser1.Document.DomDocument; mshtml.IHTMLWindow2 win = (mshtml.IHTMLWindow2)currentDoc.parentWindow;win.execScr 阅读全文

posted @ 2011-11-09 18:02 飞舞的蒲公英