when you in the SharePoint site anonymously, easily you can click on Login link and base on your authentication type either you prompted for credentials or will redirect to the login page(if FBA authentication). let's say i have the hardcode credentials in my code and want to do the same programmatically.
if i want to start from the beginning:
one of the sharepoint weakness is that you cant act for anonymous users, for instance you cant change or remove the permissions of a ListItem.
so i came to conclusion to use a user with the limited access as possible like Guest and when anonymous users in some specific page which is my Webpart in it, i use a hardcode credentials to login and redirect them to a page.
i know about impersonation and other stuff like it which is use in code behind world and it's not what i meant.
so the question is very simple, How Can I Do That?