private static void AutoDetectAppType()
{
if (System.Web.HttpContext.Current != null)
{
AppType = AppType.Web;
}
else if (!Environment.UserInteractive)
{
AppType = AppType.Service;
}
else
{
if (Console.In == StreamReader.Null)
AppType = Ent.AppType.Windows;
else
AppType = Ent.AppType.Console;
}
}
绝大部分情况满足