- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I have an application that needs to determine whether the PC it is running on is connected to a LAN. Does anyone have a snippet of Fortran code that can do this?
With many thanks in advance
Mike
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is not subject matter for this forum.
If this is a Windows application then consult MSDN. After you find a C/C++ example then see if the necessary function interfaces are available in IFWIN... modules. If not, then you will have to declare the appropriate interface blocks (looking at IFWIN... headers for guidance).
If this is a Linux applicaiton then consult the appropriate documentation for a C/C++ example then see if the necessary function interfaces are available in IF???... modules. If not, then you will have to declare the appropriate interface blocks (looking at IF???... headers for guidance).
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I suppose the real question is "what do you mean by 'connected to a LAN'? You can find out if there is an IP address, but that doesn't really tell you if the system is connected to anything else. What are you going to do with the information? It can get especially tricky as the system may have more than one network adapter, and these might be connected to separate networks (or not connected at all).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sample Fortran code using Win32 API fucntions to find the IP and MAC addresses for all installed network adapters was posted here back in December: http://software.intel.com/en-us/forums/topic/280504. Having a valid IP address would certainly be a precondition for the availability of network communications. Suggest you check MSDN for other API functions, since the opsys certainly knows when a network is available.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page