forked from MatNyaga/NewPOS
/
oscheck.cs
76 lines (69 loc) · 2.23 KB
/
oscheck.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
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace NewPOS
{
public partial class compatibilitycheck : Form
{
static bool is64BitProcess = (IntPtr.Size == 8);
static bool is64BitOperatingSystem = is64BitProcess || InternalCheckIsWow64();
[DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool IsWow64Process([In] IntPtr hProcess,[Out] out bool wow64Process);
public static bool InternalCheckIsWow64()
{
if ((Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1) ||
Environment.OSVersion.Version.Major >= 6)
{
using (Process p = Process.GetCurrentProcess())
{
bool retVal;
if (!IsWow64Process(p.Handle, out retVal))
{
return false;
}
return retVal;
}
}
else
{
return false;
}
}
public compatibilitycheck()
{
InitializeComponent();
}
private void compatibilitycheck_Load(object sender, EventArgs e)
{
if (InternalCheckIsWow64())
{
label1.Text = "64 bit";
}
else
{
label1.Text = "32 bit";
}
}
private void login_Click(object sender, EventArgs e)
{
LoginForm form1 = new LoginForm();
form1.Show();
this.Hide();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(this,"Please replace the Database Now", "Databasse Replacement",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
merchantlogin merch = new merchantlogin();
merch.Show();
}
}
}