示例#1
0
 public static void CreateDir(Settings settings, string dir)
 {
     WebRequest req = WebRequest.Create(settings.Url + dir);
     req.Method = WebRequestMethods.Ftp.MakeDirectory;
     req.Credentials = new NetworkCredential(settings.User, Crypto.DecryptString(settings.EncryptedPassword));
     using (WebResponse resp = req.GetResponse()) { }
 }
 public FormSettings(Settings settings)
 {
     InitializeComponent();
     this.settings = settings;
     txtUrl.Text = settings.Url;
     txtUser.Text = settings.User;
     txtPass.Text = Crypto.DecryptString(settings.EncryptedPassword);
 }
示例#3
0
 public static void UploadFile(Settings settings, string dir, string fileName, byte[] fileContent)
 {
     using (WebClient wc = new WebClient())
     {
         wc.Credentials = new NetworkCredential(settings.User, Crypto.DecryptString(settings.EncryptedPassword));
         wc.UploadData(settings.Url + dir + "/" + fileName, fileContent);
     }
 }
 public ResizeAndUpload(FormStart mainForm, Settings settings, string sourceDir, string galleryName, string maxImgSize)
 {
     this.settings = settings;
     this.sourceDir = sourceDir;
     this.galleryName = galleryName;
     int.TryParse(maxImgSize, out this.maxImgSize);
     this.mainForm = mainForm;
     files = Directory.GetFiles(sourceDir, "*.jpg");
 }
 public FormStart()
 {
     InitializeComponent();
     settings = Settings.Load();
 }