Results 1 to 3 of 3

Thread: QHostInfo IP Detection under Vista

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2006
    Posts
    23
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default QHostInfo IP Detection under Vista

    Next code is woring well under all win system before vista.
    Qt Code:
    1. QString ipAddress;
    2. QHostInfo info = QHostInfo::fromName( QHostInfo::localHostName() );
    3. QList<QHostAddress> listAddr= info.addresses();
    4. ipAddress = listAddr.first().toString();
    To copy to clipboard, switch view to plain text mode 
    Under vista this code giving IPv6 addr. (FE80:0:0:0:4B1:.....)
    Any ideas?
    Last edited by marcel; 4th May 2008 at 10:23. Reason: missing [code] tags

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.