读取Mc1000的 唯一 ID 机器号

本文介绍了一个用于配置嵌入式设备的注册表设置示例,并提供了一个用于获取设备ID的静态方法。此外,还展示了如何通过按键操作来实现数据的导入、导出、清除等功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

以下为类程序;--------------------------------------------------------------------
; FILENAME: museStart.reg
;
; Copyright(c) 2007 Wood. All rights reserved.
;
; DESCRIPTION: Registry setting used by Wood managed class libraries
;
; NOTES NONE
;
; Coder:yanghang
;
;
;--------------------------------------------------------------------



; For Symbol Dotnet SDK
[HKEY_CURRENT_USER/Software/Symbol/Startup/Programs/Prog10]
"Name"="/windows/wceload.exe"
"Command"="/noaskdest /Application/ARM/Dot.cab"
"Continue"=dword:0
"ColdBootOnly"=dword:1


; For Windows CE .NET devices
[HKEY_CURRENT_USER/Software/Symbol/Startup/Programs/Prog11]
"Name"="/windows/wceload.exe"
"Command"="/noaskdest /Application/ARM/symbol.cab"
"Continue"=dword:0
"ColdBootOnly"=dword:1


; For Dotnet SqlCe20
[HKEY_CURRENT_USER/Software/Symbol/Startup/Programs/Prog15]
"Name"="/windows/wceload.exe"
"Command"="/noaskdest /Application/ARM/sqlce20.CAB"
"Continue"=dword:0
"ColdBootOnly"=dword:1




[HKEY_LOCAL_MACHINE/Drivers/BuiltIn/TermConfig/Devices/Touch]
;
; indicates which configure type, from 0 - MAX_CONFIG_TYPE
;
"ConfigType"=dword:7
;
; ConfigData value - translates dword data (in hex) to meaningful string name
;
"0"="NoTouch"
"1"="PreProduction"
"2"="Production"

[HKEY_LOCAL_MACHINE/Drivers/BuiltIn/TermConfig/Devices/Touch/Startup]
"RegSection"=dword:80000001 ; HKCU
"RegPath"="Software//Symbol//Startup"
"RegOverride"=dword:1

[HKEY_CURRENT_USER/Software/Symbol/Startup]
"Path"="//Application//Startup"
"NoSetup"=dword:1
"ForceCalibrate"=dword:1
"AllowUserEscape"=dword:1

[HKEY_CURRENT_USER/Software/Symbol/Startup/Configurations/NoTouch]
"ForceCalibrate"=dword:0
"SkipCalibrate"=dword:1

;--------------------------------------------------------------------
; FILENAME: museStart.reg
;
; Copyright(c) 2007 Wood. All rights reserved.
;
; DESCRIPTION: Registry setting used by Wood managed class libraries
;
; NOTES NONE
;
; Coder:yanghang
;
;
;--------------------------------------------------------------------



; For Symbol Dotnet SDK
[HKEY_CURRENT_USER/Software/Symbol/Startup/Programs/Prog10]
"Name"="/windows/wceload.exe"
"Command"="/noaskdest /Application/ARM/Dot.cab"
"Continue"=dword:0
"ColdBootOnly"=dword:1


; For Windows CE .NET devices
[HKEY_CURRENT_USER/Software/Symbol/Startup/Programs/Prog11]
"Name"="/windows/wceload.exe"
"Command"="/noaskdest /Application/ARM/symbol.cab"
"Continue"=dword:0
"ColdBootOnly"=dword:1


; For Dotnet SqlCe20
[HKEY_CURRENT_USER/Software/Symbol/Startup/Programs/Prog15]
"Name"="/windows/wceload.exe"
"Command"="/noaskdest /Application/ARM/sqlce20.CAB"
"Continue"=dword:0
"ColdBootOnly"=dword:1

  •  /// <summary>
      /// 获取设备id
      /// </summary>
      /// <returns></returns>
      public static string  GetDevid()
      {
       string uuid="";
       Symbol.ResourceCoordination
    .TerminalInfo  terminalInfo = new Symbol.ResourceCoordination.TerminalInfo();
       foreach (byte b in terminalInfo.UniqueUnitID)
        uuid += b.ToString("X2");
       return uuid;
      }

     


    ;--------------------------------------------------------------------
    ; FILENAME: museStart.reg
    ;
    ; Copyright(c) 2007 Wood. All rights reserved.
    ;
    ; DESCRIPTION: Registry setting used by Wood managed class libraries
    ;
    ; NOTES  NONE
    ;
    ; Coder:yanghang
    ;
    ;
    ;--------------------------------------------------------------------

     

    ; For Symbol Dotnet SDK
    [HKEY_CURRENT_USER/Software/Symbol/Startup/Programs/Prog10]
    "Name"="/windows/wceload.exe"
    "Command"="/noaskdest /Application/ARM/Dot.cab"
    "Continue"=dword:0
    "ColdBootOnly"=dword:1


    ; For Windows CE .NET devices
    [HKEY_CURRENT_USER/Software/Symbol/Startup/Programs/Prog11]
    "Name"="/windows/wceload.exe"
    "Command"="/noaskdest /Application/ARM/symbol.cab"
    "Continue"=dword:0
    "ColdBootOnly"=dword:1


    ; For Dotnet SqlCe20
    [HKEY_CURRENT_USER/Software/Symbol/Startup/Programs/Prog15]
    "Name"="/windows/wceload.exe"
    "Command"="/noaskdest /Application/ARM/sqlce20.CAB"
    "Continue"=dword:0
    "ColdBootOnly"=dword:1

    [HKEY_LOCAL_MACHINE/Drivers/BuiltIn/TermConfig/Devices/Touch]
     ;
     ; indicates which configure type, from 0 - MAX_CONFIG_TYPE
     ;
     "ConfigType"=dword:7
     ; 
     ; ConfigData value - translates dword data (in hex) to meaningful string name
     ;
     "0"="NoTouch"     
     "1"="PreProduction"
     "2"="Production"

    [HKEY_LOCAL_MACHINE/Drivers/BuiltIn/TermConfig/Devices/Touch/Startup]
     "RegSection"=dword:80000001      ; HKCU
     "RegPath"="Software//Symbol//Startup"
     "RegOverride"=dword:1

    [HKEY_CURRENT_USER/Software/Symbol/Startup]
     "Path"="//Application//Startup"
     "NoSetup"=dword:1
     "ForceCalibrate"=dword:1
     "AllowUserEscape"=dword:1

    [HKEY_CURRENT_USER/Software/Symbol/Startup/Configurations/NoTouch]
     "ForceCalibrate"=dword:0
     "SkipCalibrate"=dword:1 

     

    ; *****************************************************************************************************
    ; *** This file is provided to configure the defaults for Contrast and Backlight settings.          ***
    ; *** The template settings provided below should be uncommented to set the desired registry value. ***
    ; *** The TermConfig driver will NOT overwrite any registry keys uncommented from this file.        ***
    ; *****************************************************************************************************

    ; [HKEY_LOCAL_MACHINE/HARDWARE/DEVICEMAP/Contrast]
    ; "ContrastLevels"=dword:00000010
    ; "ContrastMin"=dword:00000009
    ; "ContrastMax"=dword:00000018
    ; "Contrast"=dword:00000007

    [HKEY_LOCAL_MACHINE/Drivers/BuiltIn/Backlight]

    "InitialState"=dword:1

     

    [HKEY_CURRENT_USER/ControlPanel/BackLight]

    "BatteryTimeout"=dword:00000000

     

    [HKEY_CURRENT_USER/ControlPanel/backlight]

    "BacklightOnTap"=dword:00000001

     


     

     switch (e.KeyCode)
       {
         ///////////////////////////////////////////////////////////////////////////////////数据
        case Keys.F1://清除数据
        
         if(File.Exists("Storage Card/CG.sdf"))
         {
          Mc.gConn.Close();
          Mc.gConn.Dispose();
          File.Delete("Storage Card/CG.sdf");
             
         }
         MessageBox.Show("全部数据清除成功,请重新启动本程序!");
         this.Close();
         break;
            case Keys.F2://导入数据
                           ChangeTextToDb();
           this.RecNum.Text="0";
             this.lbGczs.Text=Mc.InallGc();
            this.lbGczs.Refresh();
          this.lbGcZzs.Text=Mc.InallGcZs();
         this.lbGcZzs.Refresh();
             break;
        case Keys.F3://导出数据
         ChangeDbToText();
         this.RecNum.Text="0";
         break;
        case Keys.F4://清除预定库
         SqlCeCommand DelYdk=Mc.gConn.CreateCommand();
         DelYdk.CommandText="Delete from Ydk";
         DelYdk.ExecuteNonQuery(); 
         this.lbYdzs.Text = Mc.InallYd();
         this.lbGcZzs.Text=Mc.InallYdZs();
         this.lbGcZzs.Refresh();
         this.lbYdzs.Refresh();
         MessageBox.Show("预定库清除成功");
         break;
         ///////////////////////////////////////////////////////////////////////////////////数据
        case Keys.Right:
         this.CaiGou.Visible = true;
         this.ShuShangSheZhi.Visible = false;
         this.TongJi.Visible = false;
         break;
        case Keys.Down:
         this.ShuShang.Focus();
         this.CaiGou.Visible = false;
         this.ShuShangSheZhi.Visible = true;
         this.TongJi.Visible = false;
         break;
        case Keys.Up:
         //     this.lbGczs.Text = Mc.InallGc();
         this.lbYdzs.Text = Mc.InallYd();
         this.lbGcZzs.Text=Mc.InallGcZs();
         this.lbYdZzs.Text=Mc.InallYdZs();

         this.CaiGou.Visible = false;
         this.ShuShangSheZhi.Visible = false;
         this.TongJi.Visible = true;
         break;
        case Keys.Left:
         if (this.CaiGou.Visible == false && this.ShuShangSheZhi.Visible == false && this.TongJi.Visible == false)
         {
          this.Close();
          this.Dispose();
         }
         else
         {
          this.CaiGou.Visible = false;
          this.ShuShangSheZhi.Visible = false;
          this.TongJi.Visible = false;
         }
         break;
       }



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值