1. Junior Member
Join Date
Dec 1969
Posts
27

Ok, I can get the IP address of the machine via <BR>Terminal = Request.ServerVariables("remote_addr")<BR><BR>And I can parse through it as such:<BR>&#060;% <BR>Oct1 = LEFT(Terminal,2)<BR>Oct2 = LEFT(Terminal,6)<BR> Oct2 = RIGHT(Oct2,3)<BR>Oct3 = LEFT(Terminal,9)<BR> Oct3 = RIGHT(Oct3,3)<BR>%&#062;<BR><BR>What I need to do is be able to tell what each octet is WITHOUT the &#039;dots&#039;. Some of the IPs I will be querying will have 2 digit octets, and some will have 3 digit octets, etc... <BR><BR>I will be doing some math functions based on what each of the octets is, but I can&#039;t do these functions unless I know exactly what each octet is.<BR><BR>Any thoughts/suggestions would be much appreciated - thanks!<BR>

2. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## use the split function <eop>

.

3. Junior Member
Join Date
Dec 1969
Posts
27

## Huh??

Okay - perhaps I should have said at the beginning...<BR>I am a bit new at this...<BR><BR>Can you perhaps help me with some code?<BR><BR>Thanks!

4. Senior Member
Join Date
Dec 1969
Posts
96,118

## Your code makes no sense

I have an IP address of 178.34.1.37 [actual numbers altered, but the pattern is correct].<BR><BR>Your code would end up with:<BR><BR>Oct1 = "17"<BR>Oct2 = ".34"<BR>Oct3 = ".1."<BR><BR>Huh???<BR><BR>Much easier way:<BR><BR>&#060;%<BR>groups = Split(terminal,".")<BR>oct1 = groups(0)<BR>oct2 = groups(1)<BR>oct3 = groups(2)<BR>%&#062;<BR><BR>

5. Senior Member
Join Date
Dec 1969
Posts
96,118

## Click on 'VBScript Reference'...

...in the left panel of this page.<BR><BR>In the list of topics that apears, cllick on "Functions".<BR><BR>In the list of functions that appears, click on "Split".<BR><BR>Read.<BR><BR>*ALL* the function of VBScript are in that list of "Functions". <BR><BR>You might read this message from yesterday:<BR>http://www.aspmessageboard.com/forum/asp.asp?M=393629&T=393564&F=20&P=1<BR><BR><BR>

6. Junior Member
Join Date
Dec 1969
Posts
27

## RE: Your code makes no sense

EXCELLENT!!<BR>Thanks Bill!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•