Joel van Velden wrote:
>
> I'm sure it's somewhere in the windows sdk help files, but i can't find it,
> so what the heck:
>
> How do i go about programmatically getting the current IP address that's
> being used for the internet?
Winsock or Winsock2? If Winsock2 (just about all windows versions except
Win95A), there's a poorly documented io-control call that you can make which
returns a list of all the network adapters in the system along with various
properties: ip, netmask, etc. And some flags that you can check to find out
what type of adapter it is.
I have some code (in C++, but should be easy enough to translate) that
returns the IP address of the first PPP adapter in the list. Let me know if
you want it.
Another method is to query the RAS API using RasEnumConnections and
RasGetProjectionInfo. This should work, although I haven't tried it
personally. The advantage here is that it doesn't require Winsock2, so it
should work on any version of Win32.
> Also: What's the easiest and smallest way to be able to send data across the
> internet using a client/server system, but without using a component?
You can do it without components using raw Winsock calls. Not fun, but
possible. Check out these functions in the API: socket, bind, listen,
accept, select, connect and closesocket. I think that covers most of the
functions required to handle TCP and UDP sockets.
--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"