Thanks Dave for your reply.. Well i solve the problem in a different way, i just call the site with username(the default username i wanted) and a fake password.
For example,
http://dave:password@www.abc.com.
This will validate the given username and password and upon finding the wrong password the authentication pop-up window will show the username "dave"
Thanks again.