curriculum_design/Program.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/********************************************
 *			 Made by MeiZhaoRui				*
 *			 2014年05月01日 更新				*
 *******************************************/

using System;
using System.Diagnostics;
using System.Windows.Forms;
using System.IO;
using System.Threading;

namespace curriculum_design
{
	static class Program
	{
		public static SqlManage sqlManage;
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main()
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);

			if (ManyProcess() || isFirstTimeLogin()) return;
			try
			{
				sqlManage = new SqlManage("BookSale").Connect();
			}
			catch(Exception)
			{
				MsgBox.ShowError("数据库初始化失败!请删除本程序目录\n下的Config.ini文件再重新运行本程序!");
				return;
			}
			Application.Run(new Login());
			return;
		}
		private static bool ManyProcess()
		{
			///只允许一个实例
			Process pCurrent = Process.GetCurrentProcess();
			Process[] pList = Process.GetProcessesByName(pCurrent.ProcessName);
			if (pList.Length >= 2)
			{
				MsgBox.ShowError("已有程序正在运行,请等待上一个操作!", "初始化错误");
				return true;
			}
			return false;
		}

		private static bool isFirstTimeLogin()
		{
			DataSourceSetting dss = new DataSourceSetting();
			string str = INI.ReadValue("dataSource", "DataSource");
			if (str == "")
			{
				MsgBox.ShowInfor("这是您第一次登陆使用!请先配置相关!");
				dss.ShowDialog();	
			}
后面还有 6 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。