Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Proteus 1935
22
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Brazil
Posted: 13th Oct 2003 20:44
Hi all!
I made a batch file to use the ipconfig (windows app) to make a .txt file and I'm trying to read this file in DBP...

the file :


I've also made a little function that clears the spaces in a string:


But when I read the strings from the file something weird happens :




When getting the "left$(temp_string$,3)" out of a text line , the dotted (. . . . . . . .) lines only return 2 chars while non-dotted return the requested 3 chars from the left...

Any ideas?
thks

Currently coding: 3d-2d latitude/longitude
Recent coding: elliptical orbits
Proteus
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Oct 2003 20:51
If all you are trying to do is get your IP address, there is a rather nice piece of code posted by a rather clever chap into the CodeBase here : http://developer.thegamecreators.com/?m=codebase_view&i=e267800c174fe1e81a9f3bc556dee308

In answer to your question though, did you realise that the first character of each of those 'dotted' lines is a tab character that is not removed from your string by your 'killsps' function?
Proteus 1935
22
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Brazil
Posted: 13th Oct 2003 20:59
The tab char... Thanks IanM

I haven't seen the snippet youe've poited yet but the other snips I've found would only return 1 ip adress... Ow now I see that yours returns all ips thks

Currently coding: 3d-2d latitude/longitude
Recent coding: elliptical orbits
Proteus
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 15th Oct 2003 14:36
OK, but which IP is which and what does the other one do?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Oct 2003 15:10
The code shows *all* tcp networks that you are currently connected to - I assume that you are using an internal network alongside your internet connection?

There's no way to identify which are internal networks and which are internet connections - not that I'm aware of anyway.

What you can do though is display them and give the user a choice
Proteus 1935
22
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Brazil
Posted: 16th Oct 2003 03:03
with ipconfig.exe you can do that but... But it's Not as "nice"...

Currently coding: 3d-2d latitude/longitude
Recent coding: elliptical orbits
Proteus
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Oct 2003 11:06
Nope, I can't see it

The only difference I can see is that I have a gateway assigned to my internet connection and not to my internal network - but that's not enough for code to assume that one *is* an internet connection.
Proteus 1935
22
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Brazil
Posted: 17th Oct 2003 23:33 Edited at: 17th Oct 2003 23:37
I see...
How about using tracert.exe on a website, and then comparing the response to the gateway?
I don't really know if it would work, I can't test it here my cause proxy server won't allow it(Server pc is missing a monitor )...

Currently coding: 3d-2d latitude/longitude
Recent coding: elliptical orbits
Proteus
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 18th Oct 2003 00:18
Quote: " there is a rather nice piece of code posted by a rather clever chap into the CodeBase here"


Found you out Nick - you've taken over Ian's account haven't you!

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Oct 2003 00:21
Watch it!
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 18th Oct 2003 01:16
Quote: "Found you out Nick - you've taken over Ian's account haven't you!"

As if I would...


Avatar & Logo by Indi. Insert witty comment here...
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Oct 2003 01:41
As if he could

Login to post a reply

Server time is: 2026-07-26 09:30:29
Your offset time is: 2026-07-26 09:30:29