SHDocVw.InternetExplorer

I'm using SHDocVw.InternetExplorer.  The Document object has a cookie property.  How about the Session ID?  How can I access it?
LVL 1
HLRosenbergerAsked:
Who is Participating?
 
CodeCruiserConnect With a Mentor Commented:
I would try logging in programmatically using httpwebrequest and httpwebresponse objects which would give me the authentication cookie and then I can use that to download the PDF.
0
 
CodeCruiserCommented:
Session is for server right?
0
 
HLRosenbergerAuthor Commented:
I guess. I'm not sure. I'm new to this.  I'm trying to mimic what full-blown IE sends to a WEB site using SHDocVw.InternetExplorer object.   I can see the ASP.NET_SessionId sent  as a cookie using Fiddler.    I want to replicate this, making a WEBClient object cookie aware.

Does that make sense?
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
CodeCruiserCommented:
You should not have to manage cookies yourself. Does it not work?
0
 
HLRosenbergerAuthor Commented:
Here's what I am trying to do, if I can explain sufficiently.  Also, I believe you had provided input to this same issue that I worded differently in another post thread.  

I'm using SHDocVw.InternetExplorer.  I've written a screen-scraper app.  All works fine until I try to access a page that contains a PDF and nothing more - No HTML, as far as I can tell.  Full blown IE handles this of course by using Adobe to display the PDF.  However, based on what I have read, the SHDocVw.InternetExplorer does not do this.  I opened a case with Microsoft and they confirmed this, to the best of my understanding.  

So, I cannot download the PDF, which is what I want to do.   Now, the WEB site I am accessing used form-based authentication, and I need to be logged in to access the PDF.  I have had others suggest, including Microsoft, that I use a "cookies-aware" WebClient Object, which has a DownloadFile method.  However, I cannot "login" using a WebClient object.  I have been lead to believe that I can pass along from the SHDocVw.InternetExplorer object to a WebClient object the necessary cookies, including the authentication cookie, so that the DownloadFile method would work.  

Bottom line - I want to download a PDF file from a WEB site that uses Forms-Authentication.   I'm open to any idea that will work.

I hope this makes sense.
0
 
HLRosenbergerAuthor Commented:
Ok, I'll try that.
0
 
HLRosenbergerAuthor Commented:
CodeCruiser:

Can you provide code that does what your suggest?  I've been googling, but can seem to find the exact thing.  I did find this class someone wrote, but no luck getting it to work.  I'm very  new to this, and don;t really know what I'm doing.   However, I can;t believe there is not some canned thing that will do what you suggested.

http://www.visualstudiodev.com/visual-basic-express-edition/how-to-properly-use-httpwebrequest-to-login-to-a-web-site-using-forms-37678.shtml
0
 
HLRosenbergerAuthor Commented:
I got this working.  Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.