I use a 12 volt reed relay, with the coil connected to the
PCs +12v supply. The relay points leave the PC and are connected to a digital
input. One side is fed 12v and the other lead connects to your digital input.
This isolates your PC supply from the outside world.