|
-
Mar 26th, 2001, 07:51 AM
#1
Thread Starter
Addicted Member
This could probably be posted in the regular vb forum, but it deals with proxies.. so what the hey.
I have my proxy loaded into a text box like this:
34.343.343.23:80
All i need to know is how to split up the two parts to put into seperate text boxes.
For example:
text1.text would have: 34.343.343.23:80
therefore proxy.text would have 34.343.343.23
and port.text would have: 80
thanks for the help guys
-
Mar 26th, 2001, 08:50 AM
#2
Lively Member
INSTR allows you to find a specific character within a string and returns the character's position.
So something like:
Dim lngColonPos as long
lngColonPos = instr(1,text1.text,":",vbtextcompare)
'This should return the server IP
proxy.text = left$(text1.text, lngcolonpos -1)
'This should return just the port
port.text = mid$(text1.text, lngcolonpos +1)
--------------------------------------------------------------
Outta do it .... you may need to do checks of course, ie that the user actually did use a colon to separate the port etc...
Hope this helps - if not - heh, sorry I must of mis-understood the question...
-
Mar 26th, 2001, 09:37 AM
#3
Lively Member
Use the Split function in VBSCRIPT
Ex:
Dim str
str = Split("34.343.343.23:80", ":", -1, 1)
proxy.text = str(0)
port.text = str(1)
Hope this helps
Sonia
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|