SDF Sample: Device Network Routing Table

Need to view or update the Netowrk Routing  Table on your CE/ WinMo device?  Smart Device Framework 2.2’s updated NetworkInformation namespace adds a whole lot of new classes, including a full set of classes for routing table access.  Here’s a quick example of displaying the current routes:

IPRoutingTable table = IPRoutingTable.GetRoutingTable();

Debug.WriteLine(“rn*IP Routing Tablern====================”);
    “[Next Hop]”.PadLeft(17)));

foreach (IPForwardEntry entry in table)
    string intfname = entry.NetworkInterface == null ? intfname = “{Loopback}” : entry.NetworkInterface.Name;

Can’t be much simpler than that.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s