【模拟登陆网站】zxkid(如果你有勇气迈出第一步)兄弟 :继续请教你一个WebBrowser问题。。。。。。。。 你WebBrowser2直接用WebBrowser1当前网址有问题吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果是用 session 来判断的话是不行的 .. 你WebBrowser2直接用WebBrowser1当前网址有问题吗?++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++http://community.csdn.net/Expert/topic/5624/5624993.xml?temp=.9878656哈,兄弟,我是这个贴的贴主。不好意思,没分了,另开贴放分了。。那个网站的结构,你应该了解了,网站访问是必须包含验证码与密码,账号登陆的所以我只想一次验证,其它form的WebBrowser就直接用form通过验证的WebBrowser1。但如果直接传url的话,那等同于直接输入网址,同样会被返回到首页中呀 在mdi布局中,我已经在登陆页实现用户手工录入验证码登陆了,并自动跳转到某内容页。但在其它窗口的WebBrowser,也必须要显示相同的内容页,请问兄弟有什么办法吗? 在同一个FROM中的多个 WebBrowser 默认是采用同一个COOKIE 也是同一个SESSION的我不明白楼主的复制是什么意思如果是请求同样的URL,那没什么问题如果是想把HTML文档加过来 那你要自己NEW出一个DOCUMENT然后写进去了.如果是为了登陆的问题 既然COOKIE和SESSION都是一样的 那也就没什么问题 如果想对页面作特别仔细的分析并且要处理些非标准属性 那就要用到非托管DOM了 private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e) { textBox1.Text += "WB is Navigated "+e.Url.ToString()+" \r\n"; IHTMLDocument2 vDo = (IHTMLDocument2)webBrowser1.Document.DomDocument; // vDo.parentWindow.execScript("function alert(str){ window.external.HaHa(str); } var wnd=window; function window2() { this.win=wnd; this.open=function(url, target, params) { window.external.HaHa(url); }; this.unload=function() { window.external.HaHa('Out ing OK'); }; } var hjhj=new window2(); hjhj.open('http://www.baidu.com','haha','jiba'); alert('hahabubububu'); ", "javaScript"); vDo.parentWindow.execScript("function alert(str){ window.external.HaHa(str); } function window.open(url, target, params) { window.external.HaHaopen(url , target); }; function window.unload() { window.external.HaHaunld(); } ; function window.close() { window.external.HaHaclose(); } ; function window.onunload() { window.external.HaHaunld(); }; function window.onbeforeunload() { window.external.HaHaunld(); }; function cls(){ window.external.HaHaunld(); }; alert('hahabubububu'); ", "javaScript"); IHTMLDocument2 vDocument = (IHTMLDocument2)webBrowser1.Document.DomDocument; foreach (IHTMLElement vElement in vDocument.all) { if (vElement.tagName.ToUpper() == "FRAME") { textBox1.Text += "\r\nFIND FAM "+vElement.tagName+"\r\n"; IHTMLFrameBase2 vFrameBase2 = vElement as IHTMLFrameBase2; vFrameBase2.contentWindow.execScript("function alert(str){ window.external.HaHa(str); } function window.open(url, target, params) { window.external.HaHaopen(url ,target); }; function window.unload() { window.external.HaHaunld(); }; function window.close() { window.external.HaHaclose(); } ; function window.onunload() { window.external.HaHaunld(); }; function window.onbeforeunload() { window.external.HaHaunld(); }; function cls(){ window.external.HaHaunld(); }; alert('hahabubububu'); ", "javaScript"); } } } fengyecsdn(幸福的屁颠颠~HOHO )目标网站,是需要验证码与账号的,还有一点,它的会话保持,似乎与cookie无关。。SESSION应该也没有运用到。。我的初步需求是在form窗体a的WebBrowser中通过验证,关闭后,父窗口中的WebBrowser也能显示相同的已经通过验证的内容站点。 是啊,所以我想,那站点是比较典型,也是非常有效果的还有一点,它的会话保持,似乎与cookie无关。。SESSION应该也没有运用到。。zxkid(如果你有勇气迈出第一步),你用火孤浏览器,注意一下它需要post的参数。最主要的是那个uid,是随机生成的,不过这个参数的获取我得到了。。关键是如何在WebBrowser保持会话,另一个form重用 火孤浏览器 >访问首页》工具菜单>页面信息如果是post的话,需要传递这几个参数 如果这个页面不用COOKIE也不SESSION那它是靠什么维护连接信息呢?难道页面就是不能刷新么?那这个页是干什么用的?如果真是那样 你最好就在一个WEBBROWSER中处理了靠检查POST参数的话太不可靠了一旦有个小变化 就完蛋了 fengyecsdn(幸福的屁颠颠)似乎它是靠随机生成的uid来保持会话的。。汗一下至于验证码吧,哈,解板把图给用户,让手工录入了。。各位帮帮忙啊 UID? 没有SESSION拿UID干什么用?没SESSION它站点拿UID怎么验证和比较呢 Form.FormClosing事件不触发(winform) 怎样判断一个IP地址的满载率 richtext 插入文本后撤销问题 C#代码 取出字符串中出现次数最多的字符 速急 C#与C++之间的二维(多维)数组传递 想NB点啊,高手前辈们指导下 如何设置folderBrowserDialog1的初始选择路径??????? 连数据库的一点疑问,望大虾们来说说。。。 有没有更好的取Win DataGrid行、列的方法 如何在Windows程序使用指定的域用户帐号? 怎么用C#生成职称评定表啊? 用ADO读Excel时,如果Excel表的列标题不在首行,怎么办
是不行的 ..
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++http://community.csdn.net/Expert/topic/5624/5624993.xml?temp=.9878656哈,兄弟,我是这个贴的贴主。不好意思,没分了,另开贴放分了。。
那个网站的结构,你应该了解了,网站访问是必须包含验证码与密码,账号登陆的
所以我只想一次验证,
其它form的WebBrowser就直接用form通过验证的WebBrowser1。
但如果直接传url的话,那等同于直接输入网址,同样会被返回到首页中呀
在mdi布局中,我已经在登陆页实现用户手工录入验证码登陆了,并自动跳转到某内容页。
但在其它窗口的WebBrowser,也必须要显示相同的内容页,请问兄弟有什么办法吗?
我不明白楼主的复制是什么意思如果是请求同样的URL,那没什么问题
如果是想把HTML文档加过来 那你要自己NEW出一个DOCUMENT然后写进去了.
如果是为了登陆的问题 既然COOKIE和SESSION都是一样的 那也就没什么问题
如果想对页面作特别仔细的分析并且要处理些非标准属性 那就要用到非托管DOM了
{
textBox1.Text += "WB is Navigated "+e.Url.ToString()+" \r\n"; IHTMLDocument2 vDo = (IHTMLDocument2)webBrowser1.Document.DomDocument;
// vDo.parentWindow.execScript("function alert(str){ window.external.HaHa(str); } var wnd=window; function window2() { this.win=wnd; this.open=function(url, target, params) { window.external.HaHa(url); }; this.unload=function() { window.external.HaHa('Out ing OK'); }; } var hjhj=new window2(); hjhj.open('http://www.baidu.com','haha','jiba'); alert('hahabubububu'); ", "javaScript");
vDo.parentWindow.execScript("function alert(str){ window.external.HaHa(str); } function window.open(url, target, params) { window.external.HaHaopen(url , target); }; function window.unload() { window.external.HaHaunld(); } ; function window.close() { window.external.HaHaclose(); } ; function window.onunload() { window.external.HaHaunld(); }; function window.onbeforeunload() { window.external.HaHaunld(); }; function cls(){ window.external.HaHaunld(); }; alert('hahabubububu'); ", "javaScript");
IHTMLDocument2 vDocument = (IHTMLDocument2)webBrowser1.Document.DomDocument;
foreach (IHTMLElement vElement in vDocument.all)
{
if (vElement.tagName.ToUpper() == "FRAME")
{
textBox1.Text += "\r\nFIND FAM "+vElement.tagName+"\r\n"; IHTMLFrameBase2 vFrameBase2 = vElement as IHTMLFrameBase2;
vFrameBase2.contentWindow.execScript("function alert(str){ window.external.HaHa(str); } function window.open(url, target, params) { window.external.HaHaopen(url ,target); }; function window.unload() { window.external.HaHaunld(); }; function window.close() { window.external.HaHaclose(); } ; function window.onunload() { window.external.HaHaunld(); }; function window.onbeforeunload() { window.external.HaHaunld(); }; function cls(){ window.external.HaHaunld(); }; alert('hahabubububu'); ", "javaScript");
}
} }
目标网站,是需要验证码与账号的,还有一点,它的会话保持,似乎与cookie无关。。
SESSION应该也没有运用到。。
我的初步需求是在form窗体a的WebBrowser中通过验证,关闭后,父窗口中的WebBrowser也能显示相同的已经通过验证的内容站点。
是啊,所以我想,那站点是比较典型,也是非常有效果的
还有一点,它的会话保持,似乎与cookie无关。。
SESSION应该也没有运用到。。
zxkid(如果你有勇气迈出第一步),你用火孤浏览器,注意一下它需要post的参数。
最主要的是那个uid,是随机生成的,不过这个参数的获取我得到了。。关键是如何在WebBrowser保持会话,另一个form重用
难道页面就是不能刷新么?
那这个页是干什么用的?如果真是那样 你最好就在一个WEBBROWSER中处理了
靠检查POST参数的话太不可靠了
一旦有个小变化 就完蛋了
各位帮帮忙啊
没SESSION它站点拿UID怎么验证和比较呢