Click here to Skip to main content
15,885,914 members
Articles / Programming Languages / C#

DNS resolving and Parsing IP Address in Metro Style Applications (WinRT)

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
4 Mar 2013CPOL2 min read 26.3K   358   11  
DNS resolving and parsing IP address in Metro Style applications (WinRT).
<Page
    x:Class="Network_Helper.MainPage"
    IsTabStop="false"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Network_Helper"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="420*"/>
            <ColumnDefinition Width="263*"/>
        </Grid.ColumnDefinitions>
        <TextBlock HorizontalAlignment="Left" Margin="352,102,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="269" Text="Address to be Resolved " FontWeight="Bold" FontSize="24" Foreground="#FFF5DDDD" Height="44"/>
        <TextBox x:Name="txtDnsIP" HorizontalAlignment="Left" Margin="658,102,0,0" TextWrapping="Wrap" Text="www.google.com" VerticalAlignment="Top" Width="302" Height="44" Grid.ColumnSpan="2"/>
        <Button x:ConnectionId='1' x:Name="btnResolve" Content="Resolve Address" HorizontalAlignment="Left" Margin="242,102,0,0" VerticalAlignment="Top" Width="164" Height="44"                          Grid.Column="1"/>
        <TextBlock x:Name="lblResolveAddress" HorizontalAlignment="Left" Margin="352,184,0,0" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="24" Height="44" Width="894" Grid.ColumnSpan="2"/>
        <Image HorizontalAlignment="Left" Height="200" Margin="10,28,0,0" VerticalAlignment="Top" Width="314" Source="Assets/dnsflowchart-static.gif" Stretch="Fill"/>
        <TextBlock HorizontalAlignment="Left" Margin="30,280,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="294" Text="Address Comparer   " FontWeight="Bold" FontSize="24" Foreground="#FFF5DDDD" Height="44"/>
        <TextBlock HorizontalAlignment="Left" Margin="30,434,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="294" Text="Address to be compared " FontWeight="Bold" FontSize="24" Foreground="#FFF5DDDD" Height="44"/>
        <TextBlock HorizontalAlignment="Left" Margin="30,358,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="294" Text="Base Address" FontWeight="Bold" FontSize="24" Foreground="#FFF5DDDD" Height="44"/>
        <TextBox x:Name="txtBaseAddress" HorizontalAlignment="Left" Margin="352,358,0,0" TextWrapping="Wrap" Text="www.google.com" VerticalAlignment="Top" Width="494" Height="44" Grid.ColumnSpan="2"/>
        <TextBox x:Name="txtComAddress" HorizontalAlignment="Left" Margin="352,434,0,0" TextWrapping="Wrap" Text="172.194.38.145" VerticalAlignment="Top" Width="494" Height="44" Grid.ColumnSpan="2"/>
        <Button x:ConnectionId='2' x:Name="btnCompare" Content="Perform Address Comparison " HorizontalAlignment="Left" Margin="104,358,0,0" VerticalAlignment="Top" Width="302" Height="44"                          Grid.Column="1"/>
        <TextBlock x:Name="lblResullt2" HorizontalAlignment="Left" Margin="104,434,0,0" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="24" Height="44" Width="244" Grid.Column="1"/>
        <TextBlock HorizontalAlignment="Left" Margin="30,540,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="269" Text="Address Information " FontWeight="Bold" FontSize="24" Foreground="#FFF5DDDD" Height="44"/>
        <TextBox x:Name="txtUrl" HorizontalAlignment="Left" Margin="336,540,0,0" TextWrapping="Wrap" Text="www.google.com" VerticalAlignment="Top" Width="393" Height="44"/>
        <Button x:ConnectionId='3' x:Name="btnShowInfo" Content="Get Address Info" HorizontalAlignment="Left" Margin="766,540,0,0" VerticalAlignment="Top" Width="194"                           Grid.ColumnSpan="2"/>
        <TextBlock x:Name="lblResultInfo" HorizontalAlignment="Left" Margin="30,620,0,0" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="16" Height="113" Width="1216" Grid.ColumnSpan="2"/>
        <Border BorderBrush="#FF5B2828" BorderThickness="1" HorizontalAlignment="Left" Height="180" Margin="10,520,0,0" VerticalAlignment="Top" Width="1280" Grid.ColumnSpan="2"/>
        <Border BorderBrush="#FF742121" BorderThickness="1" HorizontalAlignment="Left" Height="243" Margin="10,260,0,0" VerticalAlignment="Top" Width="1280" Grid.ColumnSpan="2"/>

    </Grid>
</Page>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Software Developer (Senior)
Sri Lanka Sri Lanka
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions