Upload files to "smtpproxy.net"
This commit is contained in:
44
smtpproxy.net/Program.cs
Normal file
44
smtpproxy.net/Program.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Configuration.Install;
|
||||
using System.Reflection;
|
||||
using System.ServiceProcess;
|
||||
|
||||
namespace smtpproxy.net;
|
||||
|
||||
internal static class Program
|
||||
{
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
SMTPProxy sMTPProxy = new SMTPProxy();
|
||||
ServiceBase[] services = new ServiceBase[1] { sMTPProxy };
|
||||
if (args.Length != 0)
|
||||
{
|
||||
switch (args[0])
|
||||
{
|
||||
case "-install":
|
||||
ManagedInstallerClass.InstallHelper(new string[1] { Assembly.GetExecutingAssembly().Location });
|
||||
break;
|
||||
case "-uninstall":
|
||||
ManagedInstallerClass.InstallHelper(new string[2]
|
||||
{
|
||||
"/u",
|
||||
Assembly.GetExecutingAssembly().Location
|
||||
});
|
||||
break;
|
||||
case "-console":
|
||||
if (args.Length > 1 && args[1] == "-reload")
|
||||
{
|
||||
sMTPProxy.Reload(args[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
sMTPProxy.Start();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ServiceBase.Run(services);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user