Pointer needed to Web Code

  • Thread starter Thread starter John Veldthuis
  • Start date Start date
J

John Veldthuis

Hi, I want to be able to read a https web page, enter a user name and
password in the fields returned and then read in the information that
is returned after this and then close the connection.

I have looked around but cannot spot how to do this. Can anyone give
me a pointer to a tutorial or something or point me in the right
direction?

Cheers
 
Hi, I want to be able to read a https web page, enter a user name and
password in the fields returned and then read in the information that
is returned after this and then close the connection.

I have looked around but cannot spot how to do this. Can anyone give
me a pointer to a tutorial or something or point me in the right
direction?

Cheers

Okay have most of it working now in that I can read the page and
submit the name and password. I just use a WeRequest to send the
following

https://www.telstraclear.co.nz/usag...gin&password=mypassword&s=c&usagelogin=Submit

This should work but it does not. It returns an error saying that
element PASS is undefined in the form. Below is the source of the form
so it should work should it not as pass is there? It does fill in the
username field but won't go on the password.

Web Page Source below


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<HEAD>
<TITLE>Login to TelstraClear HighSpeed Internet Usage
Meter</TITLE>
<META NAME="Keywords" CONTENT="login, authentication">
<META NAME="Description" CONTENT="Form to login to
TelstraClear HighSpeed Internet usage meter.">
<script>
function checkForm(theForm){
var err = "";
var u = trimString(theForm.fquid.value);
var p = trimString(theForm.pass.value);
if (u.length == 0){
err = err + "- Username cannot be empty!";
}
if (p.length == 0){
err = err + "\n- Password cannot be empty!";
}
if (err.length != 0)
{
alert(err);
return false;
}
else
{
return true;
}
}


function trimString(theString) {
while (theString.charAt(0) == " ") {
theString =
theString.substring(1,theString.length);
}
while (theString.charAt(theString.length - 1) == " ")
{
theString =
theString.substring(0,theString.length - 1);
}
return theString;
}
</script>
</head>


<body bgcolor="ffffff"
onLoad="document.forms.loginForm.fquid.focus();">

<form name="loginForm" method="POST" action="/usagemeter/index.cfm"
onSubmit="return checkForm(this)">

<img src="images/dot-clear.gif" width=1 height=1 vspace=2> <br>

<table align="center" cellpadding=2 cellspacing=0 border=0
bgcolor="#999999">
<tr>
<td>
<table cellpadding=5 cellspacing=0 border=0 bgcolor="#f0f0f0">
<tr><td><font face="Arial, Helvetica" size=2
color="#666666"><b>Welcome to TelstraClear HighSpeed Internet Usage
Meter. Please Login.</b></font> </td></tr>

<tr>
<td align="center">
<font face="Arial, Helvetica" size=2
color="#666666"><b>User
Name</b><br>([email protected])</font><br>
<input type="text" name="fquid" maxlength="50"
size="30" value=""><br>
<img src="images/dot-clear.gif" width=1
height=1 vspace=2><br>
<font face="Arial, Helvetica" size=2
color="#666666"><b>Password</b></font><br>
<input type="password" name="pass"
maxlength="30" size="30" value=""><br>
<img src="images/dot-clear.gif" width=1
height=1 vspace=2><br>
<INPUT type="Hidden" name="s" value="c">
<input type="submit" name="usagelogin"
value="Submit">
</td>
</tr>
</table>
</td>
</tr>
</table>

</form>


</body>
</html>
 
John,

Did you already place this question crossposted in the newsgroups
microsoft.public.dotnet.security
and
microsoft.public.dotnet.framework.aspnet.security

I think this kind of security related questions are better on its place
there. Sending open passwords with a Get is not anymore from today.

I hope this helps,

Cor
 
John,

Did you already place this question crossposted in the newsgroups
microsoft.public.dotnet.security
and
microsoft.public.dotnet.framework.aspnet.security

No. I have only been posting here.
I think this kind of security related questions are better on its place
there. Sending open passwords with a Get is not anymore from today.

I asked for a way how and got no response so was just cobbling up
stuff as I went based on what I could find on the net. I still do not
have a way by code on how to read the first web page, log on, and then
get the data I want off the second page.

Any pointers to code on how this is done the "proper" way appreciated.
 

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

Back
Top