2014-02-24 79 views

回答

1
using (var client = new WebClient()) 
{    
    client.Credentials = new NetworkCredential(ftpUserName, ftpPassword); 
    client.DownloadFile(url, filename); 
} 
0
string auth = Convert.ToBase64String(Encoding.UTF8.GetBytes(string.format("{0}:{1}"), user, password)); 
request.Headers.Add("Authorization", string.format("Basic {0}", auth)); 
相關問題