Sorry I use this title on purpose. I m quite new on c# and i don't manage to call my class on the usual way.
I have a winform and I want to insert a class (copy and paste from an API), and call it from my winform.
This class is a program which open the console, ask me parameters and then lunch an EMG acquisition.
the class is like that:
class Program1
{
static void Main(string[] args)
{
// some code here, with a lot of "Console.Writeline"
}
}
It works fine.
I change it to:
public class Program1
{
public void method1(string[] args)
{
//some code here, , with a lot of "Console.Writeline"
}
}
And i tried to call it on my form
private void button1_Click(object sender, EventArgs e)
{
Program1 program = new Program1();
program.method1();
}
it says "No overload for method 'method1' takes 0 arguments" . The thing i don"t understand is when i run the program of the API alone it doesn't ask me anything it just runs.
I'm pretty sure the error is from the Console.WriteLine
and Console.Readline
but i don't know how to resolve my problem.
I want a button on my winform which run my class, open the console and ask me on the console which paramaters i want.
Thank you !