I want to open a page that required Basic authentication. I want to pass the Basic authentication header to the browser along with the URL.
How can i do that?
First check this code:
Dim result As String
Using wClnt As New Net.WebClient
wClnt.Credentials = New System.Net.NetworkCredential("username", "password")
Using strR As New IO.StreamReader(wClnt.OpenRead("http://ADDRESS_To_READ"))
result = strR.ReadToEnd
End Using
End Using
If it was not what your where looking for, Check this post, it may help:
How do I log into a site with WebClient?
Update:
This way you are not opening any browser. Just requesting the address you want and passing Credential.