I am trying to view report using someone else's credential. I am stuck on how to assign credential and then navigate to the URL.
Question: Is it possible to assign credential to WebRequest then navigate to the url? Something like this maybe:
WebRequest request = WebRequest.Create(repUrl);
request.Credentials = new NetworkCredential("UserName", "Password");
webBrowser1.Navigate(request.RequestUri);
I know i am able to see the report when i use something like this. But i cannot click the report:
WebRequest request = WebRequest.Create(repUrl);
request.Credentials = new NetworkCredential("Username", "Password");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader receiveStream = new StreamReader(response.GetResponseStream());
webBrowser1.ScriptErrorsSuppressed = true;
webBrowser1.DocumentStream = receiveStream.BaseStream;
Please help me on this. I stuck at this problem for too long now. Thank you.