Click here to Skip to main content
15,896,153 members
Articles / Web Development / HTML

Advanced FTP Server

Rate me:
Please Sign up or sign in to vote.
4.78/5 (26 votes)
24 Oct 2009CPOL7 min read 130.6K   20.1K   94  
Enables remote access to your files and folders via FTP
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Microsoft.VisualBasic.ApplicationServices;

namespace AdvancedFTPServer
{
    static class Program
    {
        [STAThread]
        static void Main()
        {
            try
            {
                new SIApplication().Run(new string[0]);
            }
            catch (UnauthorizedAccessException Ex)
            {
                MessageBox.Show("Advanced FTP Server is already running in background by some other user. New instance cannot be started.", "Advanced FTP Server");
            }
        }
    }

    class SIApplication : WindowsFormsApplicationBase
    {
        public SIApplication()
        {
            this.IsSingleInstance = true;
            this.EnableVisualStyles = true;

            this.ShutdownStyle = Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses;
            this.StartupNextInstance += new StartupNextInstanceEventHandler(this.Application_NewInstance);
        }

        protected override void OnCreateMainForm()
        {
            this.MainForm = new frmMain();
        }

        protected void Application_NewInstance(object sender, StartupNextInstanceEventArgs eventArgs)
        {
            this.MainForm.Invoke(new frmMain.ProcessNewInstanceDelegate(
                ((frmMain)this.MainForm).ProcessNewInstance));
        }
    }
}

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
India India


Completed B.Com(CS) at DGVC and GNIIT Software Engineering at NIIT. Resident at Chennai and working as a Software Engineer.



 Language / Technology :

C#, ADO.NET, ASP.NET, MVC, WCF, ASP, PHP, XML, Java, J2EE, HTML, JavaScript, JQuery, AngularJS, VB Script, C++, MS SQL Server, SSRS, MySql, Oracle, Oracle Forms Development, Windows, Linux.



Click here to view other articles.


Mail Me at:  shridhar_tl@ymail.com


Visit my Site:  www.iCodeIt.in


Comments and Discussions