访问网页是提示windows安全认证,用程序访问解决方案

 

WebRequest myWebRequest = WebRequest.Create("http://192.168.1.210:8810/admin/config.php?handler=reload");  

myWebRequest.PreAuthenticate = true; 

string UserName = "admin";  

string Password = "admin"; 

NetworkCredential networkCredential = new NetworkCredential(UserName, Password); 

myWebRequest.Credentials = networkCredential;

WebResponse myWebResponse = myWebRequest.GetResponse();

posted @ 2017-10-28 11:13  严于律己,宽以待人  阅读(625)  评论(0编辑  收藏  举报