This file contains hidden or 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
//static for extension.. | |
//this allows us to always make sure we're using our controls on the | |
//thread they were created on, regardless of the thread we're calling from... | |
public static class ISynchronizeInvokeExtensions | |
{ | |
public static void InvokeEx<T>(this T @this, Action<T> action) where T : ISynchronizeInvoke | |
{ | |
if (@this.InvokeRequired) | |
@this.BeginInvoke(action, new object[] { @this }); | |
else |
This file contains hidden or 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); | |
} | |
} |
NewerOlder