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