1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to get ipaddress in c#.net?

Discussion in 'C#' started by BhuvanRam, Oct 4, 2010.

  1. BhuvanRam

    BhuvanRam New Member

    Joined:
    Oct 4, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    hi friends,

    i am doing a project which is based on smtp mail server.. i need a class that ho we are accessing an message header or custom header for an incoming mails...
     
  2. techgeek.in

    techgeek.in New Member

    Joined:
    Dec 20, 2009
    Messages:
    572
    Likes Received:
    19
    Trophy Points:
    0
    Occupation:
    EOC (exploitation of computers)..i m a Terminator.
    Location:
    Not an alien!! for sure
    Home Page:
  3. richardalgor

    richardalgor New Member

    Joined:
    Feb 21, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    check this simple source code(C#)

    csharp.net-informations.com/communications/csharp-ip-address.htm

    algo.
     
  4. 7900142

    7900142 New Member

    Joined:
    Jan 12, 2011
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Free lance software developer, an instructor and a
    Location:
    Philippines
    Check my solution here:
    PHP:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Net.NetworkInformation;

    namespace 
    IPReader
    {
        class 
    Program
        
    {
            static 
    void Main(string[] args)
            {
                
    IPGlobalProperties network IPGlobalProperties.GetIPGlobalProperties();
                
    //sneak to the network
                
    TcpConnectionInformation[] tcpConnectionInformation network.GetActiveTcpConnections();
                
    //lets display the result
                
    foreach (TcpConnectionInformation item in tcpConnectionInformation)
                {
                    
    Console.WriteLine(item.RemoteEndPoint.Address.ToString());                
                }

                
    Console.ReadKey(false);
            }
        }
    }

     

Share This Page