Inserting Username and Password to web browser

O

ofiras

Hi,
I made a form application with a WebBrowser that navigates to a
certain URL. This URL is asking for a username and html before I enter
it (a message box is shown and asks for a username and password). I
already know the username and pass, so how can I make the application
automatically insert them and go straightly to the URL I want?
Please help,
Ofir.
 
O

ofiras

Hi,
I made a form application with a WebBrowser that navigates to a
certain URL. This URL is asking for a username and html before I enter
it (a message box is shown and asks for a username and password). I
already know the username and pass, so how can I make the application
automatically insert them and go straightly to the URL I want?
Please help,
Ofir.

And how do I activate a function in the page or "press" a button in
the page?
 
H

Hillbilly

You clearly are just beginning and its understandable that you do not know
that no competent programmer will code authentication the way you are asking
about because it is not secure.

ASP.NET supports a Membership, Roles and Profile system that is used to do
exactly what you probably need but not the way you are asking to get it
done.

Go to http://www.asp.net/learn/security/ and study -- ALL -- of the video
tutorials.

Hi,
I made a form application with a WebBrowser that navigates to a
certain URL. This URL is asking for a username and html before I enter
it (a message box is shown and asks for a username and password). I
already know the username and pass, so how can I make the application
automatically insert them and go straightly to the URL I want?
Please help,
Ofir.

And how do I activate a function in the page or "press" a button in
the page?
 
R

Ralph

And how do I activate a function in the page or "press" a button in
the page?

try the following to put a value into a textbox
HtmlElement tb = brow.Document.GetElementById("TextBox1");
tb.InnerText = "QWERTY";

try the following to click a button

HtmlElement Button1 = brow.Document.GetElementById("Button1");
Button1.InvokeMember("click");
 
O

ofiras

try the following to put a value into a textbox
HtmlElement tb = brow.Document.GetElementById("TextBox1");
            tb.InnerText = "QWERTY";

try the following to click a button

HtmlElement Button1 = brow.Document.GetElementById("Button1");
Button1.InvokeMember("click");

Thanks.
Question - how do I know the id of the messagebox and the textboxes in
it?
It looks like that:
http://img527.imageshack.us/img527/4743/loginmk2.jpg
And about the security problem that Hillbilly stated - I use it for
my one only, and anyway everybody knows the username and pass
(everybody that has my kind of modem).
 
M

Michael J. Ryan

If he want's to pre-authenticate to another site/application, you'll need to
either adjust the other site to accept a passed in token, for lookup, or he'll
need to actually simulate the user logging into the page in question, then
pass any cookies to the user before redirecting to the foreign site...

The latter is really bad form.. if it's for personal use, I'll often create a
bookmark, like the following...

javascript:document.forms[o].elemenst['u'].value='someuser';...forms[0].submit();

where I populate whatever values I want... if I have a bunch of users for
different classes in a test site, it's usually easier than the autologin
feature. but that's another point.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top