• 大小: 17.54MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-06-15
  • 语言: C#
  • 标签: c#  上位机  

资源简介

智能家居系统上位机实现源代码!

资源截图

代码片段和文件信息

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 ADOX;
using System.Data.OleDb;
using Microsoft.Win32;

namespace WindowsFormsApplication1
{
    
    public partial class Form1 : Form
    {
        [System.Runtime.InteropServices.DllImport(“user32“)]
        private static extern bool AnimateWindow(IntPtr hwnd int dwTime int dwFlags);
        const int AW_HOR_POSITIVE = 0x0001;
        const int AW_HOR_NEGATIVE = 0x0002;
        const int AW_VER_POSITIVE = 0x0004;
        const int AW_VER_NEGATIVE = 0x0008;
        const int AW_CENTER = 0x0010;
        const int AW_HIDE = 0x10000;
        const int AW_ACTIVATE = 0x20000;
        const int AW_SLIDE = 0x40000;
       // private System.Windows.Forms.MainMenu mainMenu1;
       /// 
       /// 
       /// 

// private System.Windows.Forms.MenuItem menuItem1;
      //  private System.Windows.Forms.MenuItem menuItem2;
        const int AW_BLEND = 0x80000;
        public Form1()
        {
            InitializeComponent();        
            //连接数据库确定状态
            join();
        }

        private void Form1_Load(object sender EventArgs e)
        {
            AnimateWindow(this.Handle 1000 AW_CENTER | AW_ACTIVATE);
        }
        private void Form1_FormClosing(object sender EventArgs e)
        {
            AnimateWindow(this.Handle 1000 AW_SLIDE | AW_HIDE | AW_VER_NEGATIVE);

        }
        private void textBox2_TextChanged(object sender EventArgs e)
        {

        }

        private void button2_Click(object sender EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender EventArgs e)
        {
            isLoad();
        }

        private void textBox3_TextChanged(object sender EventArgs e)
        {

        }
        //+++++++++++++add zhangminglei 2012.4.16
      
       //连接数据库和确认状态
        public void join()
        {
            //构造连接字符串   
            string strConnection = “Provider=Microsoft.Jet.OleDb.4.0;“;
            strConnection += @“Data Source=user.mdb“;

            OleDbConnection objConnection = new OleDbConnection(strConnection);  //建立连接   
            objConnection.Open();  //打开连接  
            //OleDbCommand sqlcmd1 = new OleDbCommand(@“INSERT INTO MyTable (Description) VALUES(‘“+“@zml‘“+“) ;‘“ objConnection);  //sql语句   
            //OleDbDataReader reader1 =sqlcmd1.ExecuteReader();              //执行查询
            OleDbCommand sqlcmd = new OleDbCommand(@“select * from MyTable where istrue = ‘1‘ “ objConnection);  //sql语句   
            OleDbDataReader reader = sqlcmd.ExecuteReader();              //执行查询 
            string username = ““;
            string pwd = ““;
            if (reader.Read())
            {
                username = (string)reader[

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      18600  2012-04-17 12:17  上位机\UI_load\WindowsFormsApplication1\bin\Debug\1.wav

     文件      25214  2003-02-16 23:32  上位机\UI_load\WindowsFormsApplication1\bin\Debug\icos\5.ICO

     文件        894  2001-07-05 18:19  上位机\UI_load\WindowsFormsApplication1\bin\Debug\icos\close.ICO

     文件        894  2001-07-05 18:19  上位机\UI_load\WindowsFormsApplication1\bin\Debug\icos\controls3.ico

     文件       4710  2000-05-22 12:10  上位机\UI_load\WindowsFormsApplication1\bin\Debug\icos\dianqi.ico

     文件        894  2001-07-05 18:19  上位机\UI_load\WindowsFormsApplication1\bin\Debug\icos\file.ico

     文件       4710  2001-01-19 13:19  上位机\UI_load\WindowsFormsApplication1\bin\Debug\icos\help.ICO

     文件      12390  2001-08-12 15:23  上位机\UI_load\WindowsFormsApplication1\bin\Debug\icos\Help1.ico

     文件       4710  2001-01-19 14:06  上位机\UI_load\WindowsFormsApplication1\bin\Debug\icos\jianshi.ico

     文件       4710  2001-05-14 17:15  上位机\UI_load\WindowsFormsApplication1\bin\Debug\icos\Load_1.ico

     文件       2238  1996-07-04 00:00  上位机\UI_load\WindowsFormsApplication1\bin\Debug\icos\rizhi.ico

     文件       4710  2000-05-20 22:30  上位机\UI_load\WindowsFormsApplication1\bin\Debug\icos\VideoCam-VGA.ico

     文件       4710  1999-03-27 23:00  上位机\UI_load\WindowsFormsApplication1\bin\Debug\icos\wenshidu.ico

     文件       4710  2000-05-21 02:08  上位机\UI_load\WindowsFormsApplication1\bin\Debug\icos\zhaoming.ico

     文件      49152  2012-04-25 08:07  上位机\UI_load\WindowsFormsApplication1\bin\Debug\Interop.ADOR.dll

     文件      36864  2012-04-25 08:07  上位机\UI_load\WindowsFormsApplication1\bin\Debug\Interop.ADOX.dll

     文件       1805  2012-04-18 15:12  上位机\UI_load\WindowsFormsApplication1\bin\Debug\photos\allrizhi.jpg

     文件     298085  2012-04-23 12:56  上位机\UI_load\WindowsFormsApplication1\bin\Debug\photos\beijing\1.jpg

     文件     142823  2012-04-23 12:58  上位机\UI_load\WindowsFormsApplication1\bin\Debug\photos\beijing\10.jpg

     文件     159552  2012-04-23 12:58  上位机\UI_load\WindowsFormsApplication1\bin\Debug\photos\beijing\11.jpg

     文件     200034  2012-04-25 11:29  上位机\UI_load\WindowsFormsApplication1\bin\Debug\photos\beijing\12.jpg

     文件     440987  2012-04-25 11:30  上位机\UI_load\WindowsFormsApplication1\bin\Debug\photos\beijing\13.jpg

     文件     157580  2012-04-25 11:30  上位机\UI_load\WindowsFormsApplication1\bin\Debug\photos\beijing\14.jpg

     文件     161176  2012-04-25 11:31  上位机\UI_load\WindowsFormsApplication1\bin\Debug\photos\beijing\15.jpg

     文件     249319  2012-04-23 12:58  上位机\UI_load\WindowsFormsApplication1\bin\Debug\photos\beijing\2.jpg

     文件     193062  2012-04-23 12:55  上位机\UI_load\WindowsFormsApplication1\bin\Debug\photos\beijing\3.jpg

     文件     115514  2012-04-23 12:55  上位机\UI_load\WindowsFormsApplication1\bin\Debug\photos\beijing\4.jpg

     文件      62644  2012-04-23 12:58  上位机\UI_load\WindowsFormsApplication1\bin\Debug\photos\beijing\5.jpg

     文件     173650  2012-04-23 13:01  上位机\UI_load\WindowsFormsApplication1\bin\Debug\photos\beijing\6.jpg

     文件      98082  2012-04-23 12:53  上位机\UI_load\WindowsFormsApplication1\bin\Debug\photos\beijing\7.jpg

............此处省略133个文件信息

评论

共有 条评论