Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I think the forum is a great idea, especially for those of us in consulting engineering. Keep up the good work!..."

Geography

Where in the world do Tek-Tips members come from?
Simmson (Programmer)
22 Feb 02 5:33
Hi
I have a program that is made in VB, now i want to have a registration page in ASP, the page wil come up when i press the register button in the program and is used to check the serial against a database on my server. Can i use Scriptlet or is there another way.
I'm new to VB so i hope to get a lot of answers.

//Simmson
Morpheus1981 (Programmer)
22 Feb 02 11:44
There's no answer if there's no question. Explain ur self then I'll help u
snowboardr (Programmer)
22 Feb 02 20:41
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!


%>





snowboardr (Programmer)
22 Feb 02 20:45
I dont know why it adds a ; to then end of a link webbrowser1.navigate "http://www.mysite.com/reigster.asp?serial="; & text1.text

But there is no ; there.

That ended up being pretty long...that took a long time to type...
chiph (Programmer)
5 Mar 02 15:25
Simmson -

It sort of sounds like you want to do something like JSP or CGI programming in VB, where the program outputs HTML to be sent to the user's browser?

If so, the answer would be that you can't, since VB doesn't really have the ability to interact with the enviromental variables like a CGI program would, nor can it write a response to be passed to a calling program.

Of course, if your question was more in line of what snowboardr answered, then ignore this  

Chip H.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close