Click here to Skip to main content
11,712,503 members (73,537 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# WinRT
I actually tried with the following code, which gave me a result of the local machine Ip address, name and the server Ip address


var hostNamesList = NetworkInformation.GetHostNames();
                    HostName serverHost = new HostName("cptdomain.ctl.local");
                    StreamSocket clientSocket = new Windows.Networking.Sockets.StreamSocket();
 
                    // Try to connect to the remote host
                    await clientSocket.ConnectAsync(serverHost, "http");
 

                    foreach (var entry in hostNamesList)
                    {
                        if (entry.Type == HostNameType.DomainName)
                        {
                 hostName.Text = "Machine Name : " + entry.DisplayName;
                 IPAddress.Text = "Machine IP : " + clientSocket.Information.LocalAddress.DisplayName;
                 ServerAddress.Text = "Server IP : " + clientSocket.Information.RemoteAddress.DisplayName;
 
                            }
                    }
                }
 

But actually my requirement is, how to get the list of IP addresses and name of the computers that are connected to the server in LAN for Windows Store Apps.
 
Please guide me in this to get the proper solution for running my store app.
 
Note: Here I was working with windows8 store apps with WinRT
Posted 26-Dec-12 0:38am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CHill60 335
1 Sergey Alexandrovich Kryukov 289
2 OriginalGriff 230
3 Andy Lanng 160
4 Maciej Los 130
0 CHill60 335
1 Sergey Alexandrovich Kryukov 280
2 OriginalGriff 230
3 Andy Lanng 160
4 Maciej Los 130


Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100