WindowsPhone Silverlight (8.0 & 8.1) : Upload files to Ftp Server (C# - XAML)

Introduction:I am very happy to write an article about FTP server access from windows phone programming using c#.net, there are no direct APIs available for leveraging FTP services in a Windows phone app.

C# (377.0 KB)
 
 
 
 
 
(0)
229 times
Add to favorites
12/27/2015
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C#
<phone:PhoneApplicationPage
    x:Class="WindowsPhoneFTP.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid VerticalAlignment="Center">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Button Name="BtnSubmit" VerticalAlignment="Center" Content="Upload to FTP" Background="#FF58E277" Click="BtnSubmit_Click"/>
        <TextBlock Name="TbckUploadStatus" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom" Text="File upload: Success" Foreground="Black"/>
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>