예제 #1
0
            public bool save()
            {
                bool isSavedSuccessfully = false;

                if (!string.IsNullOrEmpty(TxtFileFullPath))
                {
                    File.WriteAllText(TxtFileFullPath, TxtContent);
                    isSavedSuccessfully = WPFHelper.ftpSendFile(TxtFtpUrl, TxtFileFullPath, _login, _password);
                    TxtContent          = File.ReadAllText(TxtFileFullPath);
                }

                return(isSavedSuccessfully);
            }
예제 #2
0
            /// <summary>
            /// upload the image to the ftp server
            /// </summary>
            /// <returns></returns>
            public bool uploadImage()
            {
                bool isSavedSuccessfully = false;

                if (File.Exists(TxtFileFullPath))
                {
                    // closing the images stream before updating
                    closeImageSource();

                    isSavedSuccessfully = WPFHelper.ftpSendFile(TxtFtpUrl, TxtFileFullPath, _login, _password);

                    // open the images stream
                    if (isSavedSuccessfully)
                    {
                        updateImageSource();
                    }
                }
                return(isSavedSuccessfully);
            }