59 lines
1.8 KiB
C#
59 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace SuperMap.RealEstate.SecurityDevice.Setup.npPlugin
|
|
{
|
|
static class Program
|
|
{
|
|
/// <summary>
|
|
/// 应用程序的主入口点。
|
|
/// </summary>
|
|
[STAThread]
|
|
static void Main(string[] args)
|
|
{
|
|
bool isPassive = false;
|
|
string logFileName = "";
|
|
for (int i = 0; i < args.Length; i++)
|
|
{
|
|
switch (args[i].ToLower())
|
|
{
|
|
case "/passive":
|
|
isPassive = true;
|
|
break;
|
|
case "/li":
|
|
i++;
|
|
logFileName = args[i].ToLower();
|
|
break;
|
|
}
|
|
}
|
|
|
|
Application.EnableVisualStyles();
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
frmMain _frmMain = new frmMain();
|
|
if (!isPassive)
|
|
Application.Run(_frmMain);
|
|
else
|
|
{
|
|
_frmMain.Install();
|
|
}
|
|
if (!string.IsNullOrEmpty(logFileName))
|
|
{
|
|
StreamWriter _StreamWriter = File.CreateText(System.Environment.CurrentDirectory + "\\" + logFileName);
|
|
string[] _Logs= _frmMain.Log.Split(new string[]{"\n"}, StringSplitOptions.RemoveEmptyEntries);
|
|
foreach (string str in _Logs)
|
|
_StreamWriter.WriteLine(str);
|
|
_StreamWriter.WriteLine("ExitCode:0");
|
|
_StreamWriter.Flush();
|
|
_StreamWriter.Close();
|
|
}
|
|
_frmMain.Close();
|
|
}
|
|
|
|
}
|
|
}
|