|
-
July 27th, 2011, 12:45 AM
#4
Re: Get into page that requires password
Ah okay. So what you mean is that you want to programatically obtain the HTML to a page (that you are authorized to access) which is protected by a password on your local intranet? Assuming you're logging in using some sort of web form that is placing a session cookie, you should do something like this, probably: (n.b.: I've never done this before)
What you probably need to do is generate a POST the login credentials just like the form would (see, for example: http://geekswithblogs.net/rakker/arc.../21/76044.aspx).
However, you should modify this to store cookies in a CookieContainer like in: http://stackoverflow.com/questions/5...ttpwebresponse
Then use the same CookierContainer to sent a request to get the desired page.
---
Alternatively, if it's using basic authentication there is built in support for that: http://blog.kowalczyk.info/article/F...ttpWebReq.html
Does that help?
Best Regards,
BioPhysEngr
http://blog.biophysengr.net
--
All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|