Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public WebResponse Execute(NetworkCredential Credentials)
- {
- HttpWebRequest webRequest = CreateWebRequest(_url, actionUrl);
- webRequest.AllowAutoRedirect = true;
- webRequest.PreAuthenticate = true;
- webRequest.Credentials = Credentials;
- // Add headers and content into the requestStream
- asyncResult.AsyncWaitHandle.WaitOne();
- return webRequest.EndGetResponse(asyncResult);
- }
- NetworkCredential credential = new NetworkCredential();
- credential.UserName = Name;
- credential.Password = PW;
- Program.CredCache.Add(new Uri("https://blah.com/"), "Basic", credential);
- public WebResponse Execute(NetworkCredential Credentials)
- {
- HttpWebRequest webRequest = CreateWebRequest(_url, actionUrl);
- webRequest.AllowAutoRedirect = true;
- webRequest.PreAuthenticate = true;
- webRequest.Credentials = Program.CredCache;
- // more stuff down here
- }
Add Comment
Please, Sign In to add comment