2 inputs from visual studio to arduino

Hi, I have one question.
How I can get action from button on arduino in my visual studio windows form app in c#?
I search all things, but I did not found anything about that. I use Standard Firmata for communicate with arduino.

Firmata is a protocol for sending messages to your Arduino. You want to send a message TO your app on your PC. Why not just use Serial? Search the forum for "How to reliably send data" for a good overview. Bascilly, your C# app needs to open the COM port and read whatever the Arduino is sending.

Can I take example of code for this solution?

Andrija24:
Can I take example of code for this solution?

const byte buttonPin = 10;

void setup()
{
  Serial.begin(115200);
  pinMode(buttonPin, INPUT_PULLUP);
}

void loop()
{
  if (digitalRead(buttonPin) == LOW)
  {
    Serial.println("a message");
  }
}

I know code for Arduino software. Can you give me a code for c# app?
Because, I must on button click use function for print.

Can you give me a code for c# app?

You would almost certainly be better asking that question in a forum devoted to C# don't you think ?

I asked them, but they ansever me that I ask on Andruino Forum for this problem.

What did you ask them ?

The C# program is going to receive serial input. You decide what exactly is sent to the program when the button is pressed on the Arduino and what is sent when the button is not pressed or is released. The C# program does not need to know, nor does it matter, where the serial input comes from, all it needs to do is to receive and interpret the serial input. That is a question about C#, not the Arduino