0
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(); 
它在 c# WindowsFormsApplication 中运行良好
 但在 ConsoleApplication 中得到 404 响应
 (网站的 web.config )

有谁知道如何解决它?

4

0 回答 0