Solved

Download websites source

Posted on 2014-09-23
4
97 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
4 Comments
 

Expert Comment

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

Author Comment

by:DColin
ID: 40339762
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 250 total points
ID: 40342063
0
 
LVL 27

Assisted Solution

by:Ark
Ark earned 250 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now