-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathProgram.cs
More file actions
57 lines (52 loc) · 1.66 KB
/
Copy pathProgram.cs
File metadata and controls
57 lines (52 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Reflection;
using System.Windows.Forms;
using Logger;
using TDJS_Vision.Forms.YTMessageBox;
namespace TDJS_Vision
{
internal static class Program
{
public static FormMain MainForm { get; private set; } = null;
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
// HslCommunication通信库授权
if (!HslCommunication.Authorization.SetAuthorizationCode("d8868ab9-4494-4056-98c6-b669e2434e25"))
{
MessageBoxTD.Show("HslCommunication通信库授权失败!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
string solutionPath = null;
if (args.Length > 0)
{
solutionPath = args[0];
if (solutionPath.EndsWith(".Sol", StringComparison.OrdinalIgnoreCase))
{
MainForm = new FormMain(solutionPath);
// 路径合法,传递给主窗体
Application.Run(MainForm);
return;
}
}
MainForm = new FormMain(solutionPath);
Application.Run(MainForm);
}
}
}
namespace VersionInfo
{
class VersionInfo
{
public static string GetExeVer()
{
// 获取当前程序集的信息
Assembly assembly = Assembly.GetExecutingAssembly();
return assembly.GetName().Version.ToString();
}
}
}