public void ftp_list_sub() { string strReturn = ""; SecureTransfer.SSHTransferProtocol Protocol = SecureTransfer.SSHTransferProtocol.SFTP; try { st = new SecureTransfer(hosts, user, password, int.Parse(port), Protocol); st.Connect(); switch (Protocol) { case SecureTransfer.SSHTransferProtocol.SFTP: st.asyncCallback = AsyncCallback; break; } strReturn = st.List_File(dir); } catch (Exception ex) { pFrmApp.JS_Function(this.callback_error, ex.ToString()); st?.Disconnect(); st?.Dispose(); } pFrmApp.Call_Event(callback, strReturn); }
public async Task Execute(IJobExecutionContext context) { JobDataMap dataMap = context.JobDetail.JobDataMap; string file = dataMap.GetString("file"); pFrmApp = FrmApp.pTreapFrmApp.find(file); if (pFrmApp != null) { string function = pFrmApp.pSYS.value_read("event:time_event"); if ("sys:check_connect".Equals(context.JobDetail.Key.Name)) { FrmApp.pTCP.check_connect(); } else { //"sys_event_alarm" pFrmApp.JS_Function(function, context.JobDetail.Key.Name); } } await Console.Out.WriteLineAsync("Alarm_Job is executing."); }