///
///
///
public void UploadSelectFile(string drawNo)
{
MessageBox.Show("123");
var grid = VisualTreeHelper.GetChild(this, 0);
var FileName = VisualTreeHelper.GetChild(grid, 0) as TextBox;
string file = FileName.Text;
if (!string.IsNullOrEmpty(file))
{
FileInfo f = new FileInfo(file);
try
{
this.Dispatcher.BeginInvoke(new Action(() =>
{
if (!ftpIsExistsFile(drawNo, "IP", "my", "my"))
{
MakeDir(drawNo, "ip", "my", "my");
}
UploadFile(f, drawNo, "ip", "my", "my");
this.Proxy.FireCustomEvent(new CustomEventArgs("Upload", "Success", FileName));
}));
}
catch (Exception ex) { throw ex; }
}
else
{
throw new Exception("未选择文件");
}
}
以上是 客制化控件里的 方法
base.AfterButtonClick(e);
if (e.Key == "F_UPLOAD") //上传
{
try
{
this.View.GetControl("F_e_custfile").InvokeControlMethod("UploadSelectFile", _DrawNo);
}
catch (Exception ex)
{
this.View.ShowErrMessage(ex.Message);
}
}
动态表单插件里的 AfterButtonClick
但是 执行时
报
引发的异常:“System.Exception”(位于 Kingdee.BOS.Contracts.dll 中)
线程 0x2324 已退出,返回值为 0 (0x0)。
引发的异常:“System.Reflection.TargetInvocationException”(位于 mscorlib.dll 中)
引发的异常:“Kingdee.BOS.ServiceFacade.ServiceException”(位于 Kingdee.BOS.ServiceFacade.KDServiceFx.dll 中)
引发的异常:“Kingdee.BOS.ServiceFacade.ServiceException”(位于 Kingdee.BOS.ServiceFacade.KDServiceFx.dll 中)
无效 方法没有被调用~~
求助 !!!
推荐阅读