IP address in WPF
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: IP address in WPF

  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 / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,289

    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 / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,289

    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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center