473,654 Members | 3,072 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select network interface

Hi,

I would to know if there's a way to use a particular network interfaces to
access network(program matically c#). The problem is that if my wireless
network card is working, I want my application to use this one to access the
network.

Thanks
Nov 17 '05 #1
2 9417
Marc,

If you are using Sockets, then you can bind to a particular IP address
(you have to figure out on your own which network adapater has which
address). However, if you don't, then it's up to the discretion of the API
provider to provide this functionality (which most don't).

You ^could^ disable the other network card, so that the winsock layer
has no choice but to go through the network adapter that you specify, but
this can have adverse effects on other programs, and is not the best of
solutions.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Marc-André" <Ma******@discu ssions.microsof t.com> wrote in message
news:44******** *************** ***********@mic rosoft.com...
Hi,

I would to know if there's a way to use a particular network interfaces to
access network(program matically c#). The problem is that if my wireless
network card is working, I want my application to use this one to access
the
network.

Thanks

Nov 17 '05 #2
hi,

This is a rather difficult thing to do, to your app there is no
difference between the "wired" and "wireless" interface, you would have to
query the interface and see which ( if any ) is wireless.

I think you could do something like that using WMI , but not sure about it.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Marc-André" <Ma******@discu ssions.microsof t.com> wrote in message
news:44******** *************** ***********@mic rosoft.com...
Hi,

I would to know if there's a way to use a particular network interfaces to
access network(program matically c#). The problem is that if my wireless
network card is working, I want my application to use this one to access
the
network.

Thanks

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1217
by: K_Lee | last post by:
While trying to understand some issues to python's implementation of Socket, I recorded an outline to Python's socket object interface to the native implementation in a webblog type documents in our website. Just like to share it with others in case you find it useful. Each of the following lines are links to source code where the functions, macros, variables and comments are hyperlinks to each others in other source files make browse,...
1
2230
by: Neel Word | last post by:
I need to develop an application (development platform: Win2000; target platform: Win98/ME/NT4/2000/XP), which would require file transfer functionality over dial-up and network. We could develop on .NET (1.1 or 1.0 - VS.NET 02/03) or using plain COM (visual c++). We'd prefer .NET though. Does anyone know of any products or COM API (or .NET classes) that can easily handle file transfer over dial-up
6
2025
by: Paul | last post by:
Hello everyone: I am developing a VB.Net Windows Application and I am now ready to create the deployment project for it. This application needs to be installable on a different number of users / clients, and the application has an Access DB out on their network. How can I create a deployment routine where I can have a dialog box prompt for the network share (i.e. \\server\dbfolder) at install-time? Once network the share is specified...
1
2932
by: Naveen Mukkelli | last post by:
Hi, I've got 3 Network Interface Cards(NIC) in my PC. Lets say NIC1, NIC2, NIC3. I have openend network connections in control panel and renamed them to Network 1, Network 2, Network 3. I'm trying to get these names( Network 1, Network 2, Network 3) by using C#. When I tried using Win32_NetworkAdapterConfiguration class, I could get the names of the actual hardware(NIC1, NIC2, NIC3) but not the renamed names (Network 1, Network 2,...
5
3907
by: UJ | last post by:
I had already asked how to get the network settings on the machine and was told that I should use the WMI interface. I downloaded programs that will allow me to look at the stuff but I'm not sure which items are the correct ones to get. Can anybody give me a direction on where I look to figure out how to get/set the IP address, gateway, DNS Server and Proxy Server? When I look in one of the dump programs there is lots of stuff about...
8
34446
by: rongchaua | last post by:
Hi all, i would like now to disable and enable network adapter programmatically with c#. I have searched but found nothing useful. There's no topic about this problem. Has someone done with this problem? All help will be appreciated. rongchaua.
2
5798
by: Joshua Beall | last post by:
Hi All, I've got a utility I'm working on, and I want to be able to list for the user all the current network interfaces on the machine. Is there a way to do this in PHP? PHP 5.0.3, Mandriva Linux 2005 (2.6 kernel). I'm not actually in front of the machine in question, and I don't recall the minor kernel version, or the minor version of Mandriva... Any thoughts? I'd prefer not to have to run the script as root, incidentally. I...
4
2585
by: dumbkiwi | last post by:
I have written a script that uses the urllib2 module to download web pages for parsing. If there is no network interface, urllib2 hangs for a very long time before it raises an exception. I have set the socket timeout with socket.setdefaulttimeout(), however, where there is no network interface, this seems to be ignored - presumably, because without a network interface, there is nothing for the socket module to interact with.
0
3769
by: nancylife | last post by:
When developing web report, many developers use VMware to simulate different operating systems on a same server. Then, they can realize cross-platform deployment and debug of web report. According to real application of web report, I will discuss three network setting ways of VMware with all of you. Bridge way This is the simplest way as it bridges the virtual network card to a physical network card directly. It is similar to a network...
0
8372
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8591
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2709
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1915
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.