private void button1_Click(object sender, EventArgs e) { //string sqlquery = "select s_fpro from FMSUCU02"; //OleDbConnection cn = null; //OleDbCommand cmd = null; //OleDbDataAdapter da = null; //DataTable dt = null; //try //{ // Registar_Dlls(); // //"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + @"D:\POS" + ";Extended Properties=dBASE IV;User ID=Admin;" // cn = new OleDbConnection("Provider=VFPOLEDB;Data Source=" + @"D:\POS" + ";Exclusive=No"); // cmd = new OleDbCommand(sqlquery, cn); // cmd.CommandTimeout = 0; // da = new OleDbDataAdapter(cmd); // dt = new DataTable(); // da.Fill(dt); // sqlquery = "SELECT * FROM " + "fmc05602" + " WHERE (v_cfor='32' or v_cfor='31' )"; // cmd = new OleDbCommand(sqlquery, cn); // cmd.CommandTimeout = 0; // da = new OleDbDataAdapter(cmd); // dt = new DataTable(); // da.Fill(dt); // MessageBox.Show("ok", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); //} //catch(Exception exc) //{ // MessageBox.Show(exc.Message,"Aviso",MessageBoxButtons.OK,MessageBoxIcon.Error); //} Cursor.Current = Cursors.WaitCursor; string _error = ""; Basico._genera_transmision(ref _error); string cc = Basico.ejecuciontime.ToString(); MessageBox.Show(cc); //MessageBox.Show("ok==>>" + _error); Cursor.Current = Cursors.Default; }
void tmpServicio_Elapsed(object sender, ElapsedEventArgs e) { //string varchivov = "c://valida_hash.txt"; Int32 _valor = 0; try { //if (!(System.IO.File.Exists(varchivov))) if (_valida_service == 0) { _valor = 1; _valida_service = 1; string _error = ""; Basico._genera_transmision(ref _error);// Basico._ejecuta_proceso(ref _error); _valida_service = 0; if (_error.Length > 0) { TextWriter tw = new StreamWriter(@"D:\POS\Transmision.net\ERROR.txt", true); tw.WriteLine(_error); tw.Flush(); tw.Close(); tw.Dispose(); } } //**************************************************************************** } catch (Exception EXC) { TextWriter tw = new StreamWriter(@"D:\POS\Transmision.net\ERROR.txt", true); tw.WriteLine(EXC.Message); tw.Flush(); tw.Close(); tw.Dispose(); _valida_service = 0; } if (_valor == 1) { _valida_service = 0; } }