Right click VB toolbar and goto components check "Microsoft Internet Control" This will ad a globe to your toolbar. Also find Microsoft Internet Transfer control and check that as well for use later. Click the globe in the toolbar and drag in where you want your web page to show up on the form then on the Register_Click Sub add this:
webbrowser1.navigate "
http://www.mysite.com/registration.asp"
'# You could easily make a script to check the serial I would do it like this:
'# Get your database connection set up (Check planetsourcecode.com if you need help on that)
<%
Dim Serial
Serial = Request.QueryString("Serial")
'# I am not sure off hand how you would look to see if it exsists but this will at least point you in the right direction
'# So in the program, if the serial is entered into text1.text. You could visit your site with serial in the QueryString like this:
'# VB Code =
webbrowser1.navigate "
http://www.mysite.com/reigster.asp?serial=" & text1.text
'#---------
'# Then to output your serial if you need to do like this:
'# ASP code:
Response.Write "Your serial is " & Serial
'# Other tips I can give if you would rather check the serial on the the ASP page instead of trough a database then do like this:
'# ASP code =
If serial = "123456789" then
Response.write "Your registered!"
Elseif serial = "987654321" then
Response.write "Your registered!"
Else
Response.Write "That is incorrect!"
End if
'#--------------------------------------
'If you want to let your program know that the registrtion is ok then you could try this, although I am not going to show some code but I will note that you need it here etc..
'# Your ASP code:
If serial = "123456789" then
Response.write "Your registered!"
'# Redirect to this page with Certain querystring which will be used below
Response.redirect "
http://www.mysite.com/register.asp?register=ok&serial=" & serial
End if
'# ASP code:
'# Read querystring 'register' in link if "ok" then proceed to next line
If Request.QueryString("register") = "ok" then
Response.write "<html>"
'# Write some html notes for your program you want a space you will see why later..
Response.write "<!-- " & Request.QueryString(Serial) & " -->"
Response.Redirect "Your homepage"
End if
'# VB code:
'# On the toolbar click the icon with the GLOBE and it has a monitor in front of the globe (Inet) drag this on the form that
the browser is on.
'# Double click the webbrowser on your form and from the drop down select download complete.
'# Type this:
Dim CurrentURL as string
Dim MyLink as string '# for triming
Dim ReadSource() as string
dim MySource as string '# CurrentURL source
CurrentURL = webbrowser1.LocationURL '# Saves the current url of the web browser as a string
'#
http://www.mysite.com/register.asp?register=ok is how many letters = 45
MyLink = Left(CurrentURL, 45) 'Gets the information from the left over 45 characters
If MyLink = "
http://www.mysite.com/register.asp?register=ok" then
MySource = Inet1.OpenURL("" & CurrentURL)
ReadSource() = Split(MySource, " ", 10) '# Get source specifcly after spaces spaces
'# Test it with this:
'# this should show up with your serial in msgbox
msgbox ReadSource(1)
'# This functions splits up all source on the page and get its so you can use it elsewhere
'# Then I would go about saving the serial, and anyother registration information to an ini file in App.Path. Try planetsourcecode.com for examples. Hope this helps!! -
Jason
'# Good luck!
%>