Lost credentials when post

Aug 9 2004 5:40 AM
Hi, I'm trying to send a post to a form on a webserver that requires credentials. When I log in it works just fine, but when I try to post data to the webserver the credentials aren't transmitted. my source: CredentialCache myCache = new CredentialCache(); webClient.Headers.Add("Content-Type","application/x-www-form-urlencoded"); myCache.Add(new Uri("http://" + ipAdr.Text ),"Basic",new NetworkCredential("xx","xx")); webClient.Credentials = myCache; webClient.UploadValues("http://" + ipAdr.Text + "/form/newData?protocol=2","POST",isdnOppgrader); Is this the right way to do it? I have also tried myCache.Add(new Uri("http://" + ipAdr.Text + "/form/newData?protocol=2"),"Basic",new NetworkCredential("xx","xx")); and myCache.Add(new Uri("http://" + ipAdr.Text/ ),"Basic",new NetworkCredential("xx","xx")); any suggestions?

Answers (1)