?
Solved

Download websites source

Posted on 2014-09-23
4
Medium Priority
?
122 Views
Last Modified: 2014-09-26
Hi Experts,

I am downloading a website's source text into a string using the following code.

Dim sourceString As String = New System.Net.WebClient().DownloadString("website.com")

The problem I am having is that the downloaded text assumes I have not logged in. When I load the site from my browser the site assumes I am logged in via a stored cookie I presume. How can I present the cookie before downloading the source text?
0
Comment
Question by:DColin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:karunamoorthy p
ID: 40339500
>>"website.com"
show the actual site instead. I will try it for you.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 1000 total points
ID: 40342063
0
 
LVL 28

Assisted Solution

by:Ark
Ark earned 1000 total points
ID: 40345356
To use default (cached) login:
Dim wc = New System.Net.WebClient
wc.UseDefaultCredentials = True

Open in new window

To pass credentials:
wc.Credentials = new NetworkCredential("username", "password", "domain")

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

777 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