2025-08-30 13:53:59 +08:00

45 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Practices.Unity;
using MyCode.Project.Infrastructure.UnityExtensions;
using MyCode.Project.Infrastructure.Common;
using MyCode.Project.Services;
using System.Threading;
using System.Net;
namespace MyCode.Project.ScheduleTask
{
class Program
{
static void Main(string[] args)
{
// 在应用程序启动时设置如Main方法或Application_Start
System.Net.ServicePointManager.SecurityProtocol =
SecurityProtocolType.Tls12;
// 检查.NET版本并做相应处理
if (Environment.Version.Major >= 4) // .NET 4.0+
{
try
{
// 尝试设置TLS 1.2
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
}
catch (NotSupportedException)
{
// 如果失败,可能需要安装系统更新
Console.WriteLine("您的系统需要更新以支持TLS 1.2");
}
}
JobsHelp.start(AppDomain.CurrentDomain.BaseDirectory + "/JobConfig.xml");
Console.ReadKey();
}
}
}