Last active
December 15, 2015 12:28
-
-
Save ElliotWood/5259918 to your computer and use it in GitHub Desktop.
Upload a File with FTP with C# example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void Upload(string ftpServer, string userName, string password, string filename) | |
{ | |
using (System.Net.WebClient client = new System.Net.WebClient()) | |
{ | |
client.Credentials = new System.Net.NetworkCredential(userName, password); | |
client.UploadFile(ftpServer + "/" + new FileInfo(filename).Name, "STOR", filename); | |
} | |
} | |
Then it's just | |
Upload("ftp://192.168.1.1", "UserName", "Password", "2013list.html"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment