123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Runtime.InteropServices;
- using System.Text;
- using System.Threading;
- using System.Windows.Forms;
- using UAS_MES_NEW.DataOperate;
- using UAS_MES_NEW.PublicMethod;
- namespace UAS_MES_NEW
- {
- public partial class Form1 : Form
- {
- DataHelper datahelper;
- DataTable dt = new DataTable();
- public List<string> GetList()
- {
- List<string> list = new List<string>()
- {
- "Janurary","February", "March" ,"April ","May","June","July","August" ,
- "September", "October", "November", "December","张三","张三丰","小张","丰田太郎",
- "三林油田","李四张三","张冠李戴",
- "Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"
- };
- return list;
- }
- public Form1()
- {
- InitializeComponent();
- datahelper = new DataHelper();
- dt = (DataTable)datahelper.ExecuteSql("select id form loginfo","slect");
- BindingSource bs = new BindingSource();
- bs.DataSource = dt;
- dataNavigator1.DataSource = bs;
- }
- private void Form1_Load(object sender, EventArgs e)
- {
-
-
-
-
-
-
- foreach (var item in GetList())
- {
- mruEdit1.Properties.Items.Add(item);
- }
- int i = 3 << 1;
- Console.WriteLine(i+"");
- }
- [DllImport("WinIo64.dll")]
- public static extern bool InitializeWinIo();
- [DllImport("WinIo64.dll")]
- public static extern void ShutdownWinIo();
- [DllImport("WinIo64.dll")]
- public static extern bool GetPortVal(IntPtr wPortAddr, out int pdwPortVal, byte bSize);
- [DllImport("WinIo64.dll")]
- public static extern bool SetPortVal(IntPtr wPortAddr, int dwPortVal, byte bSize);
-
- [DllImport("WinIo64.dll")]
- public static extern byte MapPhysToLin(byte pbPhysAddr, uint dwPhysSize, IntPtr PhysicalMemoryHandle);
- [DllImport("WinIo64.dll")]
- public static extern bool UnmapPhysicalMemory(IntPtr PhysicalMemoryHandle, byte pbLinAddr);
- [DllImport("WinIo64.dll")]
- public static extern bool GetPhysLong(IntPtr pbPhysAddr, byte pdwPhysVal);
- [DllImport("WinIo64.dll")]
- public static extern bool SetPhysLong(IntPtr pbPhysAddr, byte dwPhysVal);
- [DllImport("user32.dll")]
- public static extern int MapVirtualKey(uint Ucode, uint uMapType);
- [DllImport("user32.dll", EntryPoint = "FindWindow")]
- private extern static IntPtr FindWindow(string lpClassName, string lpWindowName);
- [DllImport("user32.dll")]
- static extern IntPtr GetActiveWindow();
- [DllImport("user32.dll", EntryPoint = "GetWindowText")]
- public extern static int GetWindowText(IntPtr hWnd, StringBuilder lpSting, int nMaxCount);
- [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
- public static extern IntPtr GetForegroundWindow();
- public bool online = false;
-
-
- private static IntPtr data_port = (IntPtr)0x378;
- private static IntPtr state_port = (IntPtr)0x379;
- private static IntPtr control_port = (IntPtr)0x37A;
- ModeBusTCPServer md;
- private void button3_Click_1(object sender, EventArgs e)
- {
-
-
-
-
-
-
-
-
-
-
-
-
- object al = null;
- string ab = al == null ? "a" : al.ToString();
- Console.WriteLine(ab);
- }
- private void button4_Click(object sender, EventArgs e)
- {
-
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
-
-
-
-
-
-
-
-
- }
- private void tabNavigationPage2_Paint(object sender, PaintEventArgs e)
- {
- }
- private void dataNavigator1_Click(object sender, EventArgs e)
- {
-
- }
- private void dataNavigator1_ButtonClick(object sender, DevExpress.XtraEditors.NavigatorButtonClickEventArgs e)
- {
-
- if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.NextPage)
- {
- Console.WriteLine("A");
- }
-
- if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.PrevPage)
- {
- Console.WriteLine("B");
- }
-
- if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.Next)
- {
- Console.WriteLine("C");
- }
-
- if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.Prev)
- {
- Console.WriteLine("D");
- }
- }
- }
- }
|