Arduino mega 2560 how to connect to the ethernet shield.

i'm running this on Windows 7 64-bit.
IDE version is 1.0.1

i'm directly connecting to ethernet shield using cat5 patch cable. and ping is working to ethernet shield with 192.168.1.2 (i have uploaded the webserver code you referred to)
yes http://192.168.1.2:80 (although browser automatically uses 80 for http requests, i'm not taking any chances now )

and yes, becuase it is directly connected to laptop, only ethernet shield has this ip and ping fails when i disconnect it.

i was thinking that probably VM ware adapters are messing up and so i disabled all the adapters as well, but nothings working so far. i did notice one small behavior with my C# program. C# program socket connects when i have just restarted the arduino program. and if i leave the arduino code running (do not restart it) and try to restart the C# program the socket connection fails. that tells me that ethernet shield still has old connection with it and is not discarded when C# socket connection is closed. (ofcourse in arduino program code never reaches that stage where i can do client.disconnect).