59 lines
2.0 KiB
C#
59 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Xml;
|
|
using System.Windows.Forms;
|
|
using System.Configuration;
|
|
using System.Collections;
|
|
|
|
namespace Omega
|
|
{
|
|
|
|
public class SettingInfo
|
|
{
|
|
private static XmlDocument doc = new XmlDocument();
|
|
public static string OutputFolder { get; set; }
|
|
public static string BackupFolder { get; set; }
|
|
public static string Password { get; set; }
|
|
public static string DatabaseFile { get; set; }
|
|
public static string UserName { get; set; }
|
|
public static string Exclusive {get;set;}
|
|
public static string InstallId { get; set; }
|
|
public static string RegisterNo {get;set;}
|
|
public static Boolean Registered { get; set; }
|
|
public static int MinQuestionNum { get; set; }
|
|
public static void InitInfo()
|
|
{
|
|
|
|
getValues();
|
|
|
|
}
|
|
|
|
|
|
public static void getValues()
|
|
{
|
|
try
|
|
{
|
|
var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
|
|
string value = config.AppSettings.Settings["ConnectionString.MS Access (OleDb)"].Value;
|
|
string[] values = value.Split(new char[] { ';' });
|
|
string DataSource = values[1];
|
|
DatabaseFile = DataSource.Split(new char[] { '=' })[1];
|
|
OutputFolder = config.AppSettings.Settings["OutputFolder"].Value;
|
|
BackupFolder = config.AppSettings.Settings["BackupFolder"].Value;
|
|
Exclusive = config.AppSettings.Settings["Exclusive"].Value;
|
|
InstallId = Omega.FingerPrint.Value().Trim();
|
|
RegisterNo = config.AppSettings.Settings["RegisterNo"].Value;
|
|
Registered = (common.MD5Hash(InstallId.Trim().ToString()).ToUpper() == RegisterNo);
|
|
MinQuestionNum = Convert.ToInt32(config.AppSettings.Settings["MinQuestionNum"].Value);
|
|
}
|
|
catch
|
|
{
|
|
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
} |