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); }
private void btnImageUpload_Click(object sender, EventArgs e) { string strLotNumber = txtLotNumber.Text.Trim(); if (!string.IsNullOrEmpty(strLotNumber)) { string strImageFullPath = CommonFun.GetFullPath(txtSourceImagePath.Text.Trim(), _deviceElement.SourceImagePathFormat); string strFileName = strImageFullPath + strLotNumber + "." + _deviceElement.ImageExtensionName; string strResult = CommonFun.UploadFile(strFileName, _deviceElement); txtLotNumber.Text = ""; richTextBox1.Text = strResult + "\n" + richTextBox1.Text; } else { MessageBox.Show("批次号不能为空!"); } }