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#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using WindowsPhoneFTP.Resources;

namespace WindowsPhoneFTP
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }
        private void BtnSubmit_Click(object sender, RoutedEventArgs e)
        {
            UploadFile_FTP();
        }
        private async void UploadFile_FTP()
        {
            FtpClientClass ObjFtpClientClass = new FtpClientClass();
            var Result = await ObjFtpClientClass.UploadFileAsync("Hi My FileText", "MyFile");
            TbckUploadStatus.Text ="File upload: "+Result;
        }

    }
}