-2

I'm actually working on an application which converts files from unix to dos then csv to sql . Actually i got a lot of files so i did a good enumerate function , but i don't have a single idea about launching those 2 .exe in my code and make the files pass through both to fill my SQL tables .

Thanks for listening ! `

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.IO;
using Microsoft.SqlServer;
using Microsoft.VisualBasic;
using Microsoft.CSharp;
using System.Diagnostics;
namespace IMR
{
    class ProgramCSV  
    {     
          //unix2dos et csv2sql_new 
           [SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
            public static int Shell(

                string 
                bool Wait = false,
                int Timeout = -1

               )


          // Fonction Main 
        static void Main(string[] args)
        {



            DirectoryInfo dir = new DirectoryInfo("U:/Données FTP INPI/IMR_Donnees_Saisies/tc/flux/2017/06/01/0101/17");

            Console.WriteLine("Recherche de fichier .csv :"); //Fonction de recherche de tout les fichiers .csv
            foreach (var fi in dir.EnumerateFiles("*.csv",SearchOption.AllDirectories)) //On précise qu'on veut tout les répértoires
            {
                Console.WriteLine(fi.Name);
                Console.WriteLine(DateTime.Now);
            }


            Console.ReadKey(); 
        }

    } 

}

`

Filburt
  • 17,626
  • 12
  • 64
  • 115
Malik Drir
  • 37
  • 1
  • 3

1 Answers1

0

Check Process class and it's Start methods. With this you can start external exe with some parameters, you can pause your app until exe finishes or even run exe without showing window.

Pablo notPicasso
  • 3,031
  • 3
  • 17
  • 22