Ejemplo n.º 1
0
        public void Execute(ELImageDeviceElement element, String strLot)
        {
            strImageFullPath = CommonFun.GetFullPath(element.SourceImagePathRoot, element.SourceImagePathFormat);
            string   strFileName = strImageFullPath + strLot + "." + element.ImageExtensionName;
            FileInfo fInfo       = new FileInfo(strFileName);

            FtpManager.UploadFile(fInfo, element.FtpTargetFolder, element.FtpServer, element.FtpUser, element.FtpPassword);
        }
Ejemplo n.º 2
0
        public static string UploadFile(string strFileName, ELImageDeviceElement element)
        {
            string strMessage = "";

            try
            {
                if (File.Exists(strFileName))
                {
                    FileInfo fInfo = new FileInfo(strFileName);
                    FtpManager.UploadFile(fInfo, element.FtpTargetFolder, element.FtpServer, element.FtpUser, element.FtpPassword);
                    strMessage = string.Format("上传图片({0})成功", strFileName);
                }
                else
                {
                    strMessage = string.Format("图片({0})不存在", strFileName);
                }
            }
            catch (Exception err)
            {
                strMessage = err.Message;
            }
            return(strMessage);
        }