散分!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();
...全文
325 30 打赏 收藏 转发到动态 举报
写回复
用AI写文章
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
加载更多回复(10)

7,765

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧