I have a console application that runs Excel and does some stuff inside a excellarch. Now I want to make two threads that go through these working states when they take text from one excel and place it in another.
So I wrote this code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Threading;
namespace PrestaConverter
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("skriv in filvägen till Kategorifil");
string path = Console.ReadLine();
while(File.Exists(path) == false)
{
Console.WriteLine("fel filväg skriv in en ny");
path = Console.ReadLine();
}
Thread workThreadOne = new Thread(ThreadWorker(path));
}
static void ThreadWorker(string path)
{
ExcelConverter convert = new ExcelConverter();
convert.Convert(path);
}
}
}
Though when I try to make a new thread it tells me that it cant convert from void to system.threading.threadstart and I don't know what I'm doing wrong? I need new threads because I have more then one thing that needs to be done I need to multitask two methods and Threadpool as I understand it just ques the work to the existing threadpool