how to write in vb if http:// or https:// is not in string..

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
sparkicks





Posts: 151
Joined: Sat May 15, 2004 8:07 am

how to write in vb if http:// or https:// is not in string..

Post by sparkicks »

Ok i have taken making an internet explorer to the next level by making one of my own to give away on my site but how would you make it that it includes the http:// if it isnt there
Thebirthdayhat





Posts: 94
Joined: Mon Nov 15, 2004 7:01 pm
Location: over there

Post by Thebirthdayhat »

i dont really understand wat ure asking, do u mean after u go to a website make it have http//: aht the begining. xplain more of wat u mean then amybe i can help
Signature exceeded 3 lines of text.
sparkicks





Posts: 151
Joined: Sat May 15, 2004 8:07 am

Post by sparkicks »

ok normally if you type in www.google.com it will go into it and put in the http:// but in the program if you just leave it , it wont. it will do nothing if u dont put in http.
Cheech|N|Chong





Posts: 115
Joined: Fri Jan 14, 2005 9:26 am
Location: Why The Fuck Would I Tell You? Indiana...
Contact:

Post by Cheech|N|Chong »

lol i doubt someone thats 13 can make a better internet explorer...this was built by PROFESSIONALS from Microsoft...GL anyway :?
Signature exceeded 75KB.
User avatar
Phenomena





Posts: 1510
Joined: Thu Jul 01, 2004 3:25 pm
Location: Training my ducks
Contact:

Post by Phenomena »

web browsers arnt to hard to make lol
Cheech|N|Chong





Posts: 115
Joined: Fri Jan 14, 2005 9:26 am
Location: Why The Fuck Would I Tell You? Indiana...
Contact:

Post by Cheech|N|Chong »

duh...but no way he can make it better than I.E.
Signature exceeded 75KB.
Jefff




Socialist Miner Logistician Snitch!
Critic Droplet

Posts: 244
Joined: Sun Oct 24, 2004 5:59 pm

Post by Jefff »

IE isn't that good. It's just bundled with windows so everyone uses it. Back on topic, what language are you programing this browser in?
How to Post Correctly
SWYgeW91IGNhbiByZWFkIHRoaXMgeW91IGhhdmUgd2F5IHRvIG11Y2ggdGltZSBvbiB5b3VyIGhhbmRz
Thebirthdayhat





Posts: 94
Joined: Mon Nov 15, 2004 7:01 pm
Location: over there

Post by Thebirthdayhat »

i think this si wat ure talking bout.

say that the thing u type the url in is named text1 and the explorer thing is named webbrowser1, type this in the code

webbrowser1.navigate = "http//:" + text1.Text

that might work i have no idea im just guessing
Signature exceeded 3 lines of text.
Jefff




Socialist Miner Logistician Snitch!
Critic Droplet

Posts: 244
Joined: Sun Oct 24, 2004 5:59 pm

Post by Jefff »

But if the person already typed http:// that wouldn't work. If it's vb use this.

Code: Select all

If LCase(Left(URL, 7)) <> "http://" Then URL = "http://" + URL
How to Post Correctly
SWYgeW91IGNhbiByZWFkIHRoaXMgeW91IGhhdmUgd2F5IHRvIG11Y2ggdGltZSBvbiB5b3VyIGhhbmRz
sparkicks





Posts: 151
Joined: Sat May 15, 2004 8:07 am

Post by sparkicks »

Thebirthdayhat wrote:i think this si wat ure talking bout.

say that the thing u type the url in is named text1 and the explorer thing is named webbrowser1, type this in the code

webbrowser1.navigate = "http//:" + text1.Text

that might work i have no idea im just guessing
it works all right but when i go to run it , it says there is an error but it still runs
Jefff




Socialist Miner Logistician Snitch!
Critic Droplet

Posts: 244
Joined: Sun Oct 24, 2004 5:59 pm

Post by Jefff »

What is the error?
How to Post Correctly
SWYgeW91IGNhbiByZWFkIHRoaXMgeW91IGhhdmUgd2F5IHRvIG11Y2ggdGltZSBvbiB5b3VyIGhhbmRz
sparkicks





Posts: 151
Joined: Sat May 15, 2004 8:07 am

Post by sparkicks »

sry it doesnt matter the error was something to do with another thing i fixed but i still got the problem with the http if the user types it in , it doesnt get the address and one more thing how would i make it that it gets the address when i press enter aswell and Cheech|N|Chong i would just have to say that internet explorer is so crap and vb is so easy (and kinda booring cus of it) that it would take me 1 day flat out to make a new one that would be better then it but i cant prove that cus i always will have something to do and ne way the pizza would run out =)
Jefff




Socialist Miner Logistician Snitch!
Critic Droplet

Posts: 244
Joined: Sun Oct 24, 2004 5:59 pm

Post by Jefff »

On key down use this code:

Code: Select all

If KeyCode = vbKeyReturn Then
 'Code for enter key goes here
End If
How to Post Correctly
SWYgeW91IGNhbiByZWFkIHRoaXMgeW91IGhhdmUgd2F5IHRvIG11Y2ggdGltZSBvbiB5b3VyIGhhbmRz
Thebirthdayhat





Posts: 94
Joined: Mon Nov 15, 2004 7:01 pm
Location: over there

Post by Thebirthdayhat »

Private Sub Form_KeyPress(KeyAscii As Integer)
Select Case keycode
Case vbKeyReturn
"coding for watever u want to happen goes here"
End Select
End Sub
theres just another option that i like to use more often.
Signature exceeded 3 lines of text.
kaptainkommie




Wordewatician 500

Posts: 732
Joined: Wed Nov 26, 2003 11:59 pm
Location: Raleigh, NC, USA

Post by kaptainkommie »

[gx]_aaron wrote:web browsers arnt to hard to make lol
Oh of course not if you use VB's Internet Explorer control.
Post Reply