Exemplo n.º 1
0
        private void testFTP()
        {
            FTPUtility ftp = new FTPUtility(txtServer.Text, txtUser.Text, txtPass.Text);

            Color clr = ftp.test() ? Color.LightGreen : clr = Color.Pink;

            txtServer.SafeInvoke(() => { txtServer.BackColor = clr; });
            txtUser.SafeInvoke(() => { txtUser.BackColor = clr; });
            txtPass.SafeInvoke(() => { txtPass.BackColor = clr; });
        }
Exemplo n.º 2
0
        private void submit(Bitmap bmimage)
        {
            if (settings.saveToFileEnabled)
                bmimage.Save(settings.fileLocation, System.Drawing.Imaging.ImageFormat.Png);

            if (settings.ftpEnabled)
            {
                String filename = DateTime.Now.ToString("s").Replace("T", "_") + ".png";
                String tempname = Path.GetTempFileName();

                if (settings.copyLinkToClipboard)
                {
                    Clipboard.SetText(settings.linkString + filename);
                }

                bmimage.Save(tempname, System.Drawing.Imaging.ImageFormat.Png);

                FTPUtility u = new FTPUtility(settings.ftpHost, settings.ftpUser,
                    settings.ftpPass, tempname, filename);
                u.uploadFile();
            }
        }