Hello, I want to 'Programatically' differentiate between the connections made to my computer using the following: 1) LAN which can connect to the outside world. 2) An Isolated LAN 3) A simple Ethernet connection between 2 computers. The IP configurations in all the 3 cases may be either be Static or Dynamic. I can know the IP address using which the connection has been established. I tried exploring WMI Network Adapter Configurations ( Win32_NetworkAdapterConfiguration and Win32_NetworkProtocol), but could not find any information that can clearly differentiate between these 3 kinds of connections. Any Suggestions ??
Hi! If peers run in domain , workgroup 3) and 2) is the same and the difference is number of computers so you can use WNetEnumResource() to check that number. To differ connection to "outside world" you can use ping to some well-known address ( www.microsoft.com e.g. ) or use InternetCheckConnection() for that Arkady wrote in message news:1138679237.268506.45770@z14g2000cwz.googlegroups.com... > Hello, > I want to 'Programatically' differentiate between the connections made > to my computer using the following: > 1) LAN which can connect to the outside world. > 2) An Isolated LAN > 3) A simple Ethernet connection between 2 computers. > > The IP configurations in all the 3 cases may be either be Static or > Dynamic. > I can know the IP address using which the connection has been > established. > I tried exploring WMI Network Adapter Configurations ( > Win32_NetworkAdapterConfiguration and Win32_NetworkProtocol), but could > not find any information that can clearly differentiate between these 3 > kinds of connections. > Any Suggestions ?? >
suwarna.joshi@gmail.com wrote: > Hello, > I want to 'Programatically' differentiate between the connections made > to my computer using the following: > 1) LAN which can connect to the outside world. > 2) An Isolated LAN > 3) A simple Ethernet connection between 2 computers. All of these are ill defined. If you want a meaningful answer then you need to specify in great detail what you consider to be these 3 cases. Keep in mind that 'outside world' is relative as is an 'isolated' LAN etc. But even if you somehow define what these terms mean for you the answer is most likely going to be "impossible". While sitting on you local machine there really isn't a way to know much about your network topography. What exactly are you trying to accomplish? -- Eugene http://www.gershnik.com
Hello, Thank You for the suggestion. But I think I need more information to solve my problem The situation is something like this.... Assume that I have 3 Network cards on my system. Each of them connecting to the 3 different network connection types that I have mentioned in my previous mail. Now whenever a user connects to my computer, I want to know using which Network he/she has connected. WNetEnumResource( ) returns all the resources on all networks and provides no information to know the network to which the resource belongs to..(please correct me if I am wrong..) Is there a way by which I can know the Number of Resources on 'One Particular Network'?
When user connected check if her IP is of your subnet or not ( IP & Mask give subnet ) Arkady wrote in message news:1138767123.878237.63630@f14g2000cwb.googlegroups.com... > Hello, > > Thank You for the suggestion. But I think I need more information to > solve my problem > The situation is something like this.... > Assume that I have 3 Network cards on my system. Each of them > connecting to the 3 different network connection types that I have > mentioned in my previous mail. Now whenever a user connects to my > computer, I want to know using which Network he/she has connected. > WNetEnumResource( ) returns all the resources on all networks and > provides no information to know the network to which the resource > belongs to..(please correct me if I am wrong..) > Is there a way by which I can know the Number of Resources on 'One > Particular Network'? >