Click here to Skip to main content
14,300,422 members
   

C#

 
QuestionNew version of visual studio Pin
Brian_TheLion7-Aug-19 18:55
memberBrian_TheLion7-Aug-19 18:55 
AnswerRe: New version of visual studio Pin
OriginalGriff7-Aug-19 19:15
protectorOriginalGriff7-Aug-19 19:15 
GeneralRe: New version of visual studio Pin
Brian_TheLion7-Aug-19 19:27
memberBrian_TheLion7-Aug-19 19:27 
AnswerRe: New version of visual studio Pin
Swinkaran11-Aug-19 14:43
professionalSwinkaran11-Aug-19 14:43 
AnswerRe: New version of visual studio Pin
Benktesh Sharma14-Aug-19 2:11
memberBenktesh Sharma14-Aug-19 2:11 
GeneralRe: New version of visual studio Pin
Brian_TheLion14-Aug-19 17:55
memberBrian_TheLion14-Aug-19 17:55 
GeneralRe: New version of visual studio Pin
Benktesh Sharma15-Aug-19 2:09
memberBenktesh Sharma15-Aug-19 2:09 
QuestionC# Get IP Address of Primary NIC - A Question Pin
Kevin Marois7-Aug-19 7:28
professionalKevin Marois7-Aug-19 7:28 
I have 3 Network adapaters. I neeed the IP address of the primary, so I'm using this:
foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces())
            {
                if (ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
                {
                    Console.WriteLine(ni.Name);
                    foreach (UnicastIPAddressInformation ip in ni.GetIPProperties().UnicastAddresses)
                    {
                        if (ip.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                        {
                            Console.WriteLine(ip.Address.ToString());
                        }
                    }
                }
            }
The question is, does NetworkInterface.GetAllNetworkInterfaces() return them in the correct order? How do you know which is the primary?

Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: C# Get IP Address of Primary NIC - A Question Pin
Dave Kreskowiak7-Aug-19 7:31
mveDave Kreskowiak7-Aug-19 7:31 
GeneralRe: C# Get IP Address of Primary NIC - A Question Pin
Kevin Marois7-Aug-19 7:50
professionalKevin Marois7-Aug-19 7:50 
GeneralRe: C# Get IP Address of Primary NIC - A Question Pin
Dave Kreskowiak7-Aug-19 9:41
mveDave Kreskowiak7-Aug-19 9:41 
AnswerRe: C# Get IP Address of Primary NIC - A Question Pin
Randor 9-Aug-19 15:26
professional Randor 9-Aug-19 15:26 
Questionrequest.GetResponse() - The remote server returned an error: (403) Forbidden Pin
_Q12_5-Aug-19 11:53
member_Q12_5-Aug-19 11:53 
AnswerRe: request.GetResponse() - The remote server returned an error: (403) Forbidden Pin
Dave Kreskowiak5-Aug-19 12:04
mveDave Kreskowiak5-Aug-19 12:04 
GeneralRe: request.GetResponse() - The remote server returned an error: (403) Forbidden Pin
_Q12_5-Aug-19 12:21
member_Q12_5-Aug-19 12:21 
GeneralRe: request.GetResponse() - The remote server returned an error: (403) Forbidden Pin
Eddy Vluggen5-Aug-19 12:35
mveEddy Vluggen5-Aug-19 12:35 
GeneralRe: request.GetResponse() - The remote server returned an error: (403) Forbidden Pin
_Q12_5-Aug-19 12:48
member_Q12_5-Aug-19 12:48 
GeneralRe: request.GetResponse() - The remote server returned an error: (403) Forbidden Pin
Dave Kreskowiak5-Aug-19 13:37
mveDave Kreskowiak5-Aug-19 13:37 
GeneralRe: request.GetResponse() - The remote server returned an error: (403) Forbidden Pin
_Q12_5-Aug-19 13:01
member_Q12_5-Aug-19 13:01 
GeneralRe: request.GetResponse() - The remote server returned an error: (403) Forbidden Pin
Dave Kreskowiak5-Aug-19 13:38
mveDave Kreskowiak5-Aug-19 13:38 
GeneralRe: request.GetResponse() - The remote server returned an error: (403) Forbidden Pin
Dave Kreskowiak5-Aug-19 13:31
mveDave Kreskowiak5-Aug-19 13:31 
GeneralRe: request.GetResponse() - The remote server returned an error: (403) Forbidden Pin
_Q12_5-Aug-19 14:21
member_Q12_5-Aug-19 14:21 
GeneralRe: request.GetResponse() - The remote server returned an error: (403) Forbidden Pin
Dave Kreskowiak5-Aug-19 15:30
mveDave Kreskowiak5-Aug-19 15:30 
GeneralRe: request.GetResponse() - The remote server returned an error: (403) Forbidden Pin
_Q12_5-Aug-19 14:40
member_Q12_5-Aug-19 14:40 
GeneralRe: request.GetResponse() - The remote server returned an error: (403) Forbidden Pin
Dave Kreskowiak5-Aug-19 15:29
mveDave Kreskowiak5-Aug-19 15:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.