| 123456789101112131415161718192021222324252627282930313233 |
- using System;
- using System.Net;
- using System.Windows;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- namespace LocalizationTool
- {
- public partial class App : Application
- {
- /// <summary>应用图标(app.ico 以 Resource 嵌入,各窗口标题栏/任务栏共用)。</summary>
- public static ImageSource AppIcon { get; } = LoadIcon();
- private static ImageSource LoadIcon()
- {
- try
- {
- return new BitmapImage(new Uri("pack://application:,,,/app.ico"));
- }
- catch
- {
- return null;
- }
- }
- protected override void OnStartup(StartupEventArgs e)
- {
- base.OnStartup(e);
- // 保证 https 翻译接口可用(net48 默认协议不满 TLS1.2)
- ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
- }
- }
- }
|