It isn't something I have much experience of (maybe because I usually don't realize it when someone is trying to put the moves on me) but I find being extremely rude and blunt can usually get rid of most unwanted people. If a married person were to try coming on to me, I'd make it very clear that I'm not stupid enough to get involved with someone who is scummy and cowardly enough to try to break their most sacred vows; only an idiot would trust such a person. And though it's never happened, if a single guy were to show serious genuine interest (like beyond just a casual cup of coffee / tea or general office chitchat), I'd probably ask him to give me one reason why he'd be a good decision and one reason why he thinks I'd be a good decision for him.
Granted the flip side of this is that I'm probably going to end up single for life because most people tend to have this crazy idea that in such important life changing decisions they should listen to their hearts instead of their heads and I don't agree with that position. But I also seem to have a natural ability to stop unwanted advances before they start.