How to make c# bot respong to ping?

Do you have any code that responds to a PRIVMSG? Just replicate that for PING instead. What is your understanding of how IRC works? Do you understand the message format? (this influences at what level detail to help you with)
If you reply to PING with PONG foobar, it should keep the connection alive.

If you have code uploaded to a repository such as github it makes it a lot easier for folks to help.