CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2010
    Posts
    20

    IP address in WPF

    Hi friends,
    I try to get the ip of the local computer in WPF but it fail...
    I allready done that in WinForm but in WPF it does not work.
    can someone give me a little code that works?
    Thank you all.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: IP address in WPF

    Post the code that you are using to grab the IP in WinForms.

  3. #3
    Join Date
    Aug 2010
    Posts
    20

    Re: IP address in WPF

    IPAddress[] a = Dns.GetHostByName(Dns.GetHostName()).AddressList;


    string ip = a[0].ToString();
    txtIp.Text = ip;

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: IP address in WPF

    What exactly doesn't work?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured