///--------------------------------------------------------------------------
/// 文 件 名:FrmAboutUs.cs
/// 功能描述:关于
///
///
/// 创建标识:杨斌 2010-08-23
/// 修改:杨斌 2013-03-26
///--------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Management;
using GeneralLib;
namespace SunVoteARSPPT
{
public partial class FrmAboutQResponse : Form
{
public FrmAboutQResponse()
{
InitializeComponent();
//多语言初始化控件文本
//GlobalInfo.SysLanguage.SetLanguage("FrmAboutUs", this);
string bitInfo = "_32bit";//默认32位
string proInfo = System.Reflection.Assembly.GetExecutingAssembly().GetName().ProcessorArchitecture.ToString();
if (proInfo.IndexOf("64") >= 0)
{
bitInfo = "_64bit";
}
else if (proInfo == "MSIL")
{
if (GetOSBit() == 64)
{
bool retVal = false;
IsWow64Process(Process.GetCurrentProcess().Handle, out retVal);
if (!retVal)
bitInfo = "_64bit";
}
}
bitInfo += GlobalInfo.VerInfo;//Alpha/Beta
lblVerNoInfo.Text = "V " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + bitInfo;
//+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString() + "."
//+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Build.ToString();
//lblSysVersion.Text = lblSysVersion.Text + " " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();//去掉Beta,杨斌 2011-09-28
//////lblSysSoftName.Text = GetAppTitleName();//去掉问题代码。杨斌 2018-06-07
////杨斌 2018-03-23。王艳的临时方案
//lblHelpInfo.Text = "Help File";
//lblHelpInfo.Tag = GlobalInfo.APP_DIR + @"\Resources\Help\HLP.html";
//lblHelpInfo.Tag = GlobalInfo.APP_DIR + @"\Starting with Angage Quiz Plus.pdf";
lblEmailInfo.Click += new EventHandler(lblEmailInfo_Click);
lblSiteInfo.Click += new EventHandler(lblSiteInfo_Click);
lblHelpInfo.Click += LblHelpInfo_Click;
}
///
/// PowerVote定制的软件显示名称
/// 杨斌 2015-11-10
///
///
public static string GetAppTitleName()
{
if (GlobalInfo.OEMLogo2 == OEMLogos2.oemPowerVoteForORPI)//杨斌 2017-06-02
return "PowerVote for ORPI";
else
return "Angage Quiz Plus";
}
///
/// 获取版本信息
/// 杨斌 2014-06-16
///
///
public static string GetVersionInfo()
{
string res = "";
try
{
string bitInfo = "_32bit";//默认32位
string proInfo = System.Reflection.Assembly.GetExecutingAssembly().GetName().ProcessorArchitecture.ToString();
if (proInfo.IndexOf("64") >= 0)
{
bitInfo = "_64bit";
}
else if (proInfo == "MSIL")
{
if (GetOSBit() == 64)
{
bool retVal = false;
IsWow64Process(Process.GetCurrentProcess().Handle, out retVal);
if (!retVal)
bitInfo = "_64bit";
}
}
res = "V " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + bitInfo;
}
catch (Exception ex)
{
SystemLog.WriterLog(ex);
}
return res;
}
public static int GetOSBit()
{
try
{
//string addressWidth = String.Empty;
//ConnectionOptions mConnOption = new ConnectionOptions();
//ManagementScope mMs = new ManagementScope(@"\\localhost", mConnOption);
//ObjectQuery mQuery = new ObjectQuery("select AddressWidth from Win32_Processor");
//ManagementObjectSearcher mSearcher = new ManagementObjectSearcher(mMs, mQuery);
//ManagementObjectCollection mObjectCollection = mSearcher.Get();
//foreach (ManagementObject mObject in mObjectCollection)
//{
// addressWidth = mObject["AddressWidth"].ToString();
//}
//return Int32.Parse(addressWidth);
//杨斌 2015-03-17
int bit = 32;
if (Environment.Is64BitOperatingSystem)
bit = 64;
return bit;
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
return 32;
}
}
[DllImport("kernel32.dll")]
public static extern bool IsWow64Process([In] IntPtr hProcess, [Out] out bool lpSystemInfo);
private void FrmAboutUs_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)//杨斌 2012-03-13
this.Close();
}
private void lblSiteInfo_Click(object sender, EventArgs e)
{
try
{
System.Diagnostics.Process.Start(((Label)sender).Text);
}
catch { }
}
private void LblHelpInfo_Click(object sender, EventArgs e)
{
try
{
System.Diagnostics.Process.Start(((Label)sender).Tag + "");
}
catch { }
}
private void lblEmailInfo_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("mailto:" + ((Label)sender).Text);
}
}
}