Well you don’t block people using robots.txt - it is used to tell search engine bots what not to index. So if you don’t want your site in an index, use it.
You can block both bots and people using .htaccess - just deny known bots or deny people with a Google/Yahoo referrer header.
Using robots.txt is documented at http://www.robotstxt.org/
There are a couple of different ways blocking access based on referer. One of them is:
SetEnvIfNoCase Referer "^http://www.google.com/" BadReferrer
SetEnvIfNoCase Referer "^http://www.yahoo.com/" BadReferrer
deny from env=BadReferrerWhich in English causes Apache to set an environment variable if the referer is either Google or Yahoo. If the environment variable is set, access is denied and visitors get a status code “403 Forbidden”
openvein.org -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7