Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 27th, 2004, 01:23 PM
ssk ssk is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 14 ssk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m
Reputation Power: 0
Vb and HTML

i have a internet control in my form to load a webpage (online not offline) which has login textfields (uid/pwd) and submit button. i need to pass the uid/pwd from the vb form to the html text boxes and if possible autoclick the submit button.. sort of form autofill and autologin.. not able to pass the uid and password from text boxes on the form to those one the webpage.. the webpage has only 2 text boxes... tried sendkeys ("TAB") to scroll to the text boxes but aint working ?? any other way ??

Reply With Quote
  #2  
Old December 27th, 2004, 02:58 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 21 h 32 m 23 sec
Reputation Power: 180
Post some of your code.
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old December 30th, 2004, 02:36 AM
ssk ssk is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 14 ssk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m
Reputation Power: 0
if someone can tell me how to get the button to auto-click my work is almost done.. just one more query .. like one the pages that load has a frameset and both left and right pages are generated by jsp.. when i try to load the source to retrieve info it does the obvious retrieve the source of the frameset and notthe right sided page.. is there any way to get the source of the right sided page when its not a direct html link but generated by jsp.. the file is generated in internet temp folder but i am not able to connect to it .. as if the file doesnt even exist

Last edited by ssk : January 2nd, 2005 at 01:40 AM. Reason: Half of the work figured out

Reply With Quote
  #4  
Old January 2nd, 2005, 01:41 AM
ssk ssk is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 14 ssk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m
Reputation Power: 0
Quote:
Originally Posted by Doug G
Post some of your code.

this is the html code

Code:
 
<form name="form2" method="post" action="http://www1.pacenet-india.com:7001/...WebApp/MemLogin">
<div align="right"><font face="Verdana" size="2" color="#000066">
<input type="hidden" name="type" value="user"> 
</font> 
<input type="text" name="userId" size="12" class= box>
<br>
<br>
<input type="password" name="password" size="12" class= box>
<br>
<br>
<input type="image" src=buttons/login_home.gif name="Submit2" value="Submit" align="middle" width="75" height="22">
</div>
</form>


this is the vb code
Code:
 Dim fs As New FileSystemObject 
Private Sub Command1_Click()
Set strm = fs.OpenTextFile("c:\form.txt")
Do Until (AtEndOfStream)
	On Error GoTo skip
	If strm.Line = 6 Then
		Text1 = Text1 & vbCrLf & "				<input type=""text"" name=""userId"" value = """ & Text2 & """ size=""12"" class= box>"
		strm.ReadLine
	Else
		If strm.Line = 9 Then
			Text1 = Text1 & vbCrLf & "				<input type=""password"" name=""password"" value = """ & Text3 & """ size=""12"" class= box>"
			strm.ReadLine
		Else
			If strm.Line = 1 Then Text1 = strm.ReadLine Else Text1 = Text1 & vbCrLf & strm.ReadLine
		End If
	End If
Loop
skip:
strm.Close
DoEvents
DoEvents
DoEvents
fs.DeleteFile ("c:\form.txt")
fs.CreateTextFile ("C:\form.txt")
Set strm = fs.OpenTextFile("c:\form.txt", ForWriting)
strm.Write Text1
strm.Close
DoEvents
Name "C:\form.txt" As "c:\form.htm"
DoEvents
Web.Navigate ("c:\form.htm")


using the above 2 codes i was able to load the username and password to the text boxes of the html page but am still unable to click the submit button.

Reply With Quote
  #5  
Old January 2nd, 2005, 05:05 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 21 h 32 m 23 sec
Reputation Power: 180
I'd start by inserting some response.write "got to here" type statements in my asp page for debugging purposes. You can then figure how far through the page your code gets.

If you have any on error resume next statements, take them out. And use <% Option Explicit %>

Reply With Quote
  #6  
Old January 4th, 2005, 03:13 AM
ssk ssk is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 14 ssk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m
Reputation Power: 0
Talking

forget the stupid code in the post above.. i figured it out.

Code:
 
Dim fs As New FileSystemObject 'needs refernce to scrrun.dll
Dim load As Boolean
Private Sub Command1_Click()
'navigate to the page and mark load = true for identifying it as start page (as per your needs)
Web.Navigate (App.Path & "\form.htm") 'web is microsoft internet control
load = True
End Sub
Private Sub Web_DownloadBegin()
Me.Caption = "Loading"
End Sub
Private Sub Web_DownloadComplete()
' when the form loads then scroll to the text box (as per your needs) pass the uid/pwd and use vbcr to press submit
Me.Caption = Web.Locationname
	If load = True Then
		Web.SetFocus
		SendKeys vbTab
		SendKeys Text2
		SendKeys vbTab
		SendKeys Text2
		SendKeys vbCr
		load = False
	Else
	 'else code to do whatever you want with the page that loads after pressing submit
	End If
End Sub


this code will help you scroll to text boxes on a page, pass the details there are even press "Enter" on the submit button if properly tabbed using vbsendkeys

only thing i need to know, is how to load left and right pages in a frameset coz the site im trying generates pages using jsp no html so i cant directy link using web.navigate. only logic i feel is to access to the page from the temp internet folder.. but then when i use filesystem's fileexists function i get a false.. any way to figure that out ??
or does anyone know a way to copy the entire text content from a webpage that loads in the internet conrol.. i can then sort out the details i need

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Vb and HTML


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway