散分!webbrowser控件自动登陆到集成windows验证的web页面??

niaoren 2004-09-27 10:07:48
我想采用webbrowser控件自动登陆web页面,如果是采用页面验证,直接使用postdata方式实现自动登陆,现在的问题是:如果web页面采用的是windows集成验证,始终会弹出一个密码输入框?我怎样才能把用户和密码发上去呢?
我采用这种方式,还是会弹出输入框,没有通过验证,大家帮帮忙啊!
public override void LoadCre(string fileName,string userName , string userPW)
{
System.Net.CredentialCache cr = new System.Net.CredentialCache();
cr.Add(new Uri(fileName),"Negotiate", new System.Net.NetworkCredential(userName,userPW,"hnpc.com.cn"));
System.Net.WebRequest wr = System.Net.WebRequest.Create(fileName);
wr.Credentials = cr;
wr.PreAuthenticate = true;
System.Net.WebResponse myResponse = wr.GetResponse();

htmlViewPane.Navigate(myResponse.ResponseUri.ToString());
myResponse.Close();
...全文
281 点赞 收藏 30
写回复
30 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhangqiushui 2005-05-05
回复
tuoshi 2005-05-05
顶!
回复
zhaoliang_chen 2005-05-05
up
回复
comflyer0590 2005-05-05
up!!
回复
top1000 2005-05-04
两个老大到底谁强点?
关注!
回复
viyo 2005-05-04
up
回复
mba9001 2005-05-04
两个传奇人物出现,接分
回复
xinyu1225 2005-05-04
节日快乐!!!

接分
回复
singlepine 2005-05-03
再顶
回复
学习Java中 2005-04-16
up
回复
flashthunder 2005-04-16
up
回复
xubinhui 2005-04-15
帮顶
回复
melonlee 2005-04-12
UP
回复
saucer 2004-09-30
you need to implement IAuthenticate interface, here is some code in C++:

SAMPLE: Progress Uses IAuthenticate to Bind to Secured Web Page
http://support.microsoft.com/default.aspx?scid=kb;en-us;156905



but there are some issues which, I am not sure, are resolved, see

BUG: Implementation of IAuthenticate to Bypass the Username or Password Dialog Box May Fail
http://support.microsoft.com/default.aspx?scid=kb;EN-US;320153

BUG: Proxy Authentication Through IAuthenticate May Fail on Secure URL
http://support.microsoft.com/default.aspx?kbid=329802
回复
xiaohutushen 2004-09-30
UP
回复
leezjs 2004-09-30
jie
回复
BlueLevin 2004-09-30
UP
回复
happyjun2000 2004-09-30
接分
回复
skyeenet 2004-09-30
顶一下
回复
cjzlxy 2004-09-30
up
回复
发动态
发帖子
非技术区
创建于2007-09-28

7681

社区成员

.NET技术 非技术区
申请成为版主
社区公告
暂无公告