programmatically access different NICs when sending web request
hobbyist/non-profession programmer here. I don't have a strong grasp on network addressing.
I have a computer 开发者_开发问答that simultainiously connects to two different networks. 1 through wireless, one by network cable.
In my DotNet (c#) windows form app, I would like it to send some requests to one of the networks through one of the NICs, and other requests through the other one.
How would I specify/set (some dotNet object property?) which network/NIC the request flows through?
Use Socket.Bind() before connecting to specify a particular local endpoint before establishing the connection. Depending on which of the 2 local ips you have you bind it should go through one interface or the other.
精彩评论