the task is for .net console app, need to login with my credentials into websites protected
by form authentication. I would like to have two methods with following signature:
CookieContainer DoFormLogin (string LoginUrl, string UserName,string Password, string UsernameParameterName, string PasswordParameterName );
string GetWebPage (string ProtectedUrl, CookieContainer LoginCookies);
the final working code block should be:
CookieContainer = DoFormLogin("[login to view URL]","Bob","usa123","txtUserName","txtPassword");
string WebPageSourceCode1=GetWebPage("[login to view URL]", CookieContainer );
string WebPageSourceCode2=GetWebPage("[login to view URL]", CookieContainer );
CookieContainer should be updated in case session changes during GetWebPage() calls, if session
expired it should automatically relogin.
You do not have to do exactly like this, do it as you wish , this is just to show you an idea of what I need it for,
you can implement your own flow. Please if you use Try/Catch please use dummy method for error loging called:
LogInfo (Exception ex) and re-throw error after loging. You can use classes but you do not have to, whatever is faster for you.
I have also another simular project but using oAuth with LinkedIn API. Whoever gets this one done will also get to do
it (but all through freelancer.com, I will send you personal invite or however it works here I do not know yet.) I am from USA
can also speak Russian. I have free international calls and can call you if you would like to discuss.