Click here to Skip to main content
15,894,460 members

Comments by Jeddi khan (Top 9 by date)

Jeddi khan 28-Mar-15 9:15am View    
I am not getting ".Select(d=>d.Address)
//You can .First or .Last to get a single address"
Jeddi khan 26-Mar-15 13:09pm View    
But what a pathetic situation it is:
The following function gives me correct gateway IP on my PC:

static string NetworkGateway()
{
string ip = null;

foreach (NetworkInterface f in NetworkInterface.GetAllNetworkInterfaces())
{
if (f.OperationalStatus == OperationalStatus.Up)
{
foreach (GatewayIPAddressInformation d in f.GetIPProperties().GatewayAddresses)
{
ip = d.Address.ToString();
}
}
}

Console.WriteLine(string.Format("Network Gateway: {0}", ip));
return ip;
}



And this function on another PC gives:- ::

Why so?
Jeddi khan 26-Mar-15 13:08pm View    
I installed VS 2013 on the other machine(where i was testing) and on debug i got the same error:IndexOutOfrangeException
Jeddi khan 25-Mar-15 7:46am View    
I would tell you then
Jeddi khan 25-Mar-15 7:45am View    
Okay,,,,,let me install the latest VS on remote machine.....I would test it then