FrmAboutDrawViewVote.cs
7.05 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
///--------------------------------------------------------------------------
/// 文 件 名: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 FrmAboutDrawViewVote : Form
{
public FrmAboutDrawViewVote()
{
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
////杨斌 2015-05-29
//lblServiceInfo.Text = "+86-731-85123999";
//lblSupportInfo.Text = "+86-18908457700";
//List<string> lstLanCN = new List<string>();
//lstLanCN.Add("Simplified Chinese".ToLower());
//lstLanCN.Add("Traditional Chinese".ToLower());
//if (lstLanCN.Contains(GlobalInfo.SysLanguage.LanguageName.ToLower()))
//{
// lblEmailInfo.Text = "support@psunsy.com.cn";
// lblSiteInfo.Text = "http://www.psunsky.com.cn/";
//}
//else
//{
// lblEmailInfo.Text = "support@sunvote.com.cn";
// lblSiteInfo.Text = "http://www.sunvote.com.cn/";
//}
lblEmailInfo.Click += new EventHandler(lblEmailInfo_Click);
lblSiteInfo.Click += new EventHandler(lblSiteInfo_Click);
if (GlobalInfo.OEMLogo2 == OEMLogos2.oem龙阳市金创新)
{
lblSysSoftName.Text = "SunVote 智慧课堂反馈系统(标准版)";
lblService.Text = "福建销售热线:";
lblServiceInfo.Text = "0597-2257886 18950880092";
lblSupportInfo.Text = "18050423818(傅小姐)18950880092(林先生)";
lblEmailInfo.Text = "729795406@qq.com";
lblSite.Visible = lblSiteInfo.Visible = false;
this.Height -= lblCopyRightInfo.Top - lblSiteInfo.Top;
lblCopyRight.Top = lblSite.Top;
lblCopyRightInfo.Top = lblSiteInfo.Top;
}
}
/// <summary>
/// 获取版本信息
/// 杨斌 2014-06-16
/// </summary>
/// <returns></returns>
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 (FrmAboutPowerVote.GetOSBit() == 64)
{
bool retVal = false;
FrmAboutPowerVote.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 lblEmailInfo_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("mailto:" + ((Label)sender).Text);
}
private void btnTestErr_Click(object sender, EventArgs e)
{
try
{
int i = 0;
int j = 10 / i;
}
catch (Exception ex)
{
SystemLog.WriterLog(ex, true);
}
}
private void FrmAboutUs_Load(object sender, EventArgs e)
{
}
}
}