Its not that easy to do via C#. There's no management api exposed that'll allow you to check this programmatically directly. If you want to do this, you're going to have to make c# code to call the appropriate powershell cmdlet. There is an example in SO here:
You'll need to reference the system.management.automation assembly to do the business. The cmdlet you need to call is Get-CacheHost as it'll tell you whether the services are up or down. However, I've had some gotcha's with this. When you execute the cmdlet, it needs to be done under elevated rights. Also, the account your are executing it under needs to have administrative rights on the machine in the cache cluster you are pointed at. So.. this is not ideal. I tried to do this and stopped because of this.