HttpWebRequest request = (HttpWebRequest)WebRequest.Create(fileLocation); request.Credentials = new NetworkCredential(userName, password, domainName); request.AllowAutoRedirect = true; WebResponse response = (HttpWebResponse)request.GetResponse(); using (FileStream stream = new FileStream(Path.Combine(currentDirectory, fileName), FileMode.Create, FileAccess.Write)) { response.GetResponseStream().CopyTo(stream); } response.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)