-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
38 lines (37 loc) · 1.18 KB
/
Program.cs
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
using System;
using System.Collections.Generic;
using System.Threading;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using CourseRecorder.Course;
using System.Configuration;
namespace CourseRecorder
{
internal static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
public static CourseEventPublisher cep;
public static CourseManager cm;
[STAThread]
static void Main()
{
string ServerAddress = ConfigurationManager.AppSettings["ServerAddress"];
if (ServerAddress == null)
{
MessageBox.Show("请在配置文件中配置服务器地址", Application.ProductName);
return;
}
cm = new CourseManager(ServerAddress);
cep = new CourseEventPublisher();
Thread cmThread = new System.Threading.Thread(Program.cm.Connect);
cmThread.Name = "cmThread";
cmThread.Start();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}