If you can do that, this is all you need:
Code:
IntPtr etHandle = FindWindow(null, "ET Console");
SetForegroundWindow(etHandle);
// delete etkey
SendKeys.SendWait("pb_cdkeyreg~");
// votekick unban
int rand = RandomNumber(1, 5000);
SendKeys.SendWait("net_port " + rand.ToString() + "~");
SendKeys.SendWait("net_restart~");