Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# sp_attach_db execute Pin
Heath Stewart3-May-04 4:36
protectorHeath Stewart3-May-04 4:36 
GeneralIPv6 help Pin
bouli3-May-04 2:10
bouli3-May-04 2:10 
GeneralRe: IPv6 help Pin
Jeff Varszegi3-May-04 2:29
professionalJeff Varszegi3-May-04 2:29 
GeneralRe: IPv6 help Pin
bouli3-May-04 2:43
bouli3-May-04 2:43 
GeneralRe: IPv6 help Pin
Heath Stewart3-May-04 2:45
protectorHeath Stewart3-May-04 2:45 
GeneralRe: IPv6 help Pin
bouli3-May-04 2:51
bouli3-May-04 2:51 
GeneralRe: IPv6 help Pin
Heath Stewart3-May-04 3:06
protectorHeath Stewart3-May-04 3:06 
GeneralRe: IPv6 help Pin
Heath Stewart3-May-04 2:44
protectorHeath Stewart3-May-04 2:44 
First, you must make sure you compile against (or run against, although you won't be able to (easily) support IPv6 in the latter case) the .NET Framework v1.1.

Take this simple example:
using System;
using System.Net;
using System.Net.Sockets;

public class IPAddresses
{
  static void Main(string[] args)
  {
    string name = Environment.MachineName;
    if (args.Length > 0)
      name = args[0];

    IPHostEntry host = Dns.GetHostByName(name);
    foreach (IPAddress address in host.AddressList)
    {
      Console.WriteLine("{0,15}: {1}", address.AddressFamily, address);
      if (address.AddressFamily == AddressFamily.InterNetworkV6)
        Console.WriteLine("                 ScopeID: {0}", address.ScopeId);
    }
  }
}
You can simply get the IPHostEntry using the Dns class and enumerate the IPAddresses.

Having your .NET application support IPv6 really isn't an issue. .NET already supports this - all you have to do is leverage it, such as allowing for IPv6 formatted addresses or checking for IPv6 support and trying to connect using IPv6.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: IPv6 help Pin
bouli3-May-04 3:18
bouli3-May-04 3:18 
GeneralRe: IPv6 help Pin
Heath Stewart3-May-04 3:23
protectorHeath Stewart3-May-04 3:23 
QuestionPrograming USB in c++? Pin
lyto3-May-04 1:37
lyto3-May-04 1:37 
AnswerRe: Programing USB in c++? Pin
Corinna John3-May-04 1:50
Corinna John3-May-04 1:50 
QuestionBrowse files and folder control? Pin
Marlun2-May-04 23:19
Marlun2-May-04 23:19 
AnswerRe: Browse files and folder control? Pin
Mazdak3-May-04 1:51
Mazdak3-May-04 1:51 
GeneralRe: Browse files and folder control? Pin
Heath Stewart3-May-04 2:27
protectorHeath Stewart3-May-04 2:27 
GeneralRe: Browse files and folder control? Pin
Marlun3-May-04 2:51
Marlun3-May-04 2:51 
GeneralRe: Browse files and folder control? Pin
Heath Stewart3-May-04 3:08
protectorHeath Stewart3-May-04 3:08 
GeneralRe: Browse files and folder control? Pin
Marlun3-May-04 6:01
Marlun3-May-04 6:01 
AnswerRe: Browse files and folder control? Pin
Meysam Mahfouzi3-May-04 2:06
Meysam Mahfouzi3-May-04 2:06 
GeneralRe: Browse files and folder control? Pin
Marlun3-May-04 2:52
Marlun3-May-04 2:52 
GeneralCalling crypt32.dll functions from C# Pin
jamie__smith2-May-04 22:55
jamie__smith2-May-04 22:55 
GeneralRe: Calling crypt32.dll functions from C# Pin
Mazdak3-May-04 1:47
Mazdak3-May-04 1:47 
GeneralRe: Calling crypt32.dll functions from C# Pin
Heath Stewart3-May-04 2:25
protectorHeath Stewart3-May-04 2:25 
GeneralRe: Calling crypt32.dll functions from C# Pin
jamie__smith3-May-04 3:33
jamie__smith3-May-04 3:33 
GeneralRe: Calling crypt32.dll functions from C# Pin
Heath Stewart3-May-04 3:46
protectorHeath Stewart3-May-04 3:46 

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.