?
Solved

SHDocVw.InternetExplorer

Posted on 2012-08-30
8
Medium Priority
?
1,656 Views
Last Modified: 2012-09-07
I'm using SHDocVw.InternetExplorer.  The Document object has a cookie property.  How about the Session ID?  How can I access it?
0
Comment
Question by:HLRosenberger
  • 5
  • 3
8 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38352436
Session is for server right?
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 38354299
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
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38355424
You should not have to manage cookies yourself. Does it not work?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:HLRosenberger
ID: 38355632
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
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 38355750
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
 
LVL 1

Author Comment

by:HLRosenberger
ID: 38365096
Ok, I'll try that.
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 38368037
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
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 38375945
I got this working.  Thanks.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Loops Section Overview
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question