WebRequest ConsoleApplication问题

时间:2013-10-16 04:20:54

标签: c# webrequest

url = @"http://website"; 
WebRequest request = WebRequest.Create(url); 
request.Credentials = CredentialCache.DefaultCredentials; 
//request.Credentials = new System.Net.NetworkCredential("id", "pw","domain"); 
HttpWebResponse response = (HttpWebResponse)request.GetResponse(); 
 it works well in c# WindowsFormsApplication 
 but get 404 response in ConsoleApplication 
 ( web.config of website  )

有人知道如何解决吗?

0 个答案:

没有答案