473,396 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Passing passwords to Web site

Hi,

I'm using this very simple code to open a web site and it works perfectly.

The site requires that I enter a User Name and password.

I'd like to send those with the application but after making all sorts
of trials to pass the values as parameters - nothing happens.

Can some one guide how to to this - or say it's not possible?
Regards

Laurie

Public Class Form1

Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load

WebBrowser1.Navigate("http://WebAddress/?disablechatbrowsercheck=0")

End Sub
End Class
Jun 27 '08 #1
1 888
Unless the server setting is turned on allowing you to pass username and
password along with the string (look at the string after you successfully log
in) you will have to do it manually. I say have to, which isn't quite true,
but it is easier.

Look at the source code and find the name of the textbox for each, and the
button name.

I use this sub to set text into textboxes, just pass in the textbox name and
the text you want in it: (wb is the name of my webbrowser)

Sub setText(ByVal _inputName, ByVal _text)
'given an input name and text, the textbox will be populated with
_text
Dim inputs As HtmlElementCollection =
wb.Document.GetElementsByTagName("Input")
Dim input As HtmlElement
For Each input In inputs
If input.Name = _inputName Then
input.InnerText = _text
End If
Next
End Sub

Do that, and then use this sub for clicking a button, just pass in the
button name. Keep in mind this is sometimes case sensitive:

Sub clickButton(ByVal _btnName)
'clicks a button with the supplied name
Dim buttons As HtmlElementCollection =
wb.Document.GetElementsByTagName("input")
Dim button As HtmlElement
For Each button In buttons
If button.Name.Contains(_btnName) Then
button.InvokeMember("Click")
End If
Next
End Sub

Hope that helps
--
-John
Please rate when your question is answered to help us and others know what
is helpful.
"Laurie Comerford" wrote:
Hi,

I'm using this very simple code to open a web site and it works perfectly.

The site requires that I enter a User Name and password.

I'd like to send those with the application but after making all sorts
of trials to pass the values as parameters - nothing happens.

Can some one guide how to to this - or say it's not possible?
Regards

Laurie

Public Class Form1

Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load

WebBrowser1.Navigate("http://WebAddress/?disablechatbrowsercheck=0")

End Sub
End Class
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Florent | last post by:
Hi, I run a few sites and I want to log in my main site database when/if there is a problem, (like a page not found or an unknown agent). But I don't want to give direct access to my database...
5
by: Stone | last post by:
I have a compiled Pcode VB6 application with 1 published and 9 never-published alphanumeric string contants embedded in the program for passwords. The code simply has lines like this in a FORM...
4
by: ecPunk | last post by:
Hi, We have a web application where we want a user to be able to change his/her password if the password has expired but we are unable to do this with ASP (at the moment) because we can't log...
3
by: John Buchmann | last post by:
In my web.config, I have a section that has a name and password: <credentials passwordFormat="Clear"> <user name="aaa" password="bbb" /> </credentials> Is this secure? What is to stop...
0
by: Chris Leffer | last post by:
Hi. I have a regularexpression validator that I use to validate passwords for my application. I am trying to use this expression to force my users to type 8 to 25 characters, with at least one...
10
by: dee | last post by:
Hi I'm writing a page withing our site that requires logins. Where should the logins and passwords be kept? SqlServer/Access? Flat files? What are the options and trade offs? Thanks. Dee
0
by: scoomey | last post by:
Hi folks- I've got an interesting problem. For our homebrewed PHP intranet application, I will soon be required to give users access to their email/calendar information from Microsoft Exchange....
19
by: Cord-Heinrich Pahlmann | last post by:
Hi, I have written a tool wich de/encrypts a few of my forum and bloggin-Passwords. My question is how secure it is. The following describes how I have encrypted my passwords. When I log in,...
7
by: wozza | last post by:
hi I'm a Dreamweaver user who's created a few simple data entry/ registrations forms in my time, but I'm not really a coder (though I can follow instructions and am not afraid to dabble...) - I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.