using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms; using System.Runtime.InteropServices;//提供了一个方法集,这些方法用于分配非托管内存、复制非托管内存块、将托管类型转换为非托管类型,此外还提供了在与非托管代码交互时使用的其他杂项方法
namespace LogisticsManage
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} [DllImport("coredll.dll")]
private extern static int GetDeviceUniqueID([In, Out] byte[] appdata,
int cbApplictionData,
int dwDeviceIDVersion,
[In, Out] byte[] deviceIDOuput,
out uint pcbDeviceIDOutput); private void button1_Click(object sender, EventArgs e)
{
byte[] buffer = GetDeviceID("MyAppString");
StringBuilder sb = new StringBuilder();
for (int x = ; x < buffer.Length; x++)
{
//sb.Append('{');
sb.Append(string.Format("{0:x2}", buffer[x]));
//sb.Append("} ");
}
textBox1.Text = sb.ToString();
} private byte[] GetDeviceID(string AppString)
{
// Call the GetDeviceUniqueID
byte[] AppData = new byte[AppString.Length];
for (int count = ; count < AppString.Length; count++)
AppData[count] = (byte)AppString[count];
int appDataSize = AppData.Length;
byte[] DeviceOutput = new byte[];
uint SizeOut = ;
GetDeviceUniqueID(AppData, appDataSize, , DeviceOutput, out SizeOut);
return DeviceOutput;
}
}
}

WINCE 获取智能设备唯一编号的更多相关文章

  1. iOS获取设备唯一编号,就算删除app从新安装也不变的方法

    第三方开源代码 https://github.com/soffes/SAMKeychain 使用方法 //获取设备信息32 位字符串 -(NSString *)getDeviceString{ NSS ...

  2. Mysql表中唯一编号的分配机制

    最近遇到一个问题:高并发环境下,如何避免MYSQL一张表里的某些列不要重复. 同其他博友一样 https://blog.csdn.net/jacketinsysu/article/details/51 ...

  3. iOS 获取设备唯一标示符的方法

    在开发中会遇到应用需要记录设备标示,即使应用卸载后再安装也可重新识别的情况,在这写一种实现方式--读取设备的UUID(Universally Unique Identifier)并通过KeyChain ...

  4. iOS获取设备唯一标识的8种方法

    8种iOS获取设备唯一标识的方法,希望对大家有用. UDID UDID(Unique Device Identifier),iOS 设备的唯一识别码,是一个40位十六进制序列(越狱的设备通过某些工具可 ...

  5. Android 手机上获取物理唯一标识码[转]

    所有添加有谷歌账户的设备可以返回一个 ANDROID_ID 所有的CDMA设备对于 ANDROID_ID 和 TelephonyManager.getDeviceId() 返回相同的值(只要在设置时添 ...

  6. IOS开发之——OpenUDID的使用获取用户唯一设备

    下载网址:https://github.com/ylechelle/OpenUDID OpenUDID测试结果分析 1)优点: a.没有用到MAC地址.MAC地址跟UDID一样,存在隐私问题.不能保证 ...

  7. 获取设备唯一标识 uuid(采用第三方库SSKeychain)

    SSKeyChain 下载链接: http://pan.baidu.com/s/1booV3VD 密码: ivdi /** *  获取设备唯一标识 uuid */ +(NSString*) uuid ...

  8. ios开发——实用技术篇OC篇&获取设备唯一标识

    获取设备唯一标识 WWDC 2013已经闭幕,IOS7 Beta随即发布,界面之难看无以言表...,简直就是山寨Android. 更让IOS程序猿悲催的是,设备唯一标识的MAC Address在IOS ...

  9. Android获取手机唯一码

    大部分安卓手机都可以获取手机唯一码,但是有些手机的厂商却禁止了获取手机唯一码的权限,导致我们不能使用手机唯一码作为标识,但遇到一些必须要填的坑,我们也不能不填,所以使用以下方法来填坑,因此我们使用UU ...

随机推荐

  1. java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.ProgressBar$SavedState

    java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.Progress ...

  2. Python执行系统命令的方法 os.system(),os.popen(),commands

    os.popen():用python执行shell的命令,并且返回了结果,括号中是写shell命令 Python执行系统命令的方法: https://my.oschina.net/renwofei42 ...

  3. 使用MLeaksFinder检测项目中的内存泄露

    github地址:https://github.com/Zepo/MLeaksFinder MLeaksFinder使用简单方便,可以帮助你在开发时发现内存泄露你的iOS应用.它可以自动发现和UIVi ...

  4. app跳转openURL,兼容方法

    - (void)openScheme:(NSString *)scheme {   UIApplication *application = [UIApplication sharedApplicat ...

  5. CentOS6.5源码安装python3.5.2

    前提: 1.实现自动补全需要安装模块 readline-devel (yum install -y readline-devel) 2.实现支持SSL协议需安装模块 openssl-devel (yu ...

  6. 【BZOJ2874】训练士兵(主席树)

    题意:有一个N*M的矩阵,给出一些形如(x1,y1,x2,y2,s)的操作,代表(x1,y1)到(x2,y2)都被加上了s这个数 现在有一些强制在线的询问,询问(x1,y1)到(x2,y2)的和 对于 ...

  7. bootstrap 模态 modal 小例子

    bootstrap 模态 modal  小例子 <html> <head> <meta charset="utf-8" /> <title ...

  8. ELK日志管理之——kibana部署

    1.kibana安装 [root@localhost ~]# wget https://download.elastic.co/kibana/kibana/kibana-4.1.1-linux-x64 ...

  9. AndroidSQLite多出一个(db.journal文件原因)

    今天在Android开发中中将sqlite的数据库创建之后,发现生成的.db文件的旁边 生成了一个大小为0的与数据库文件同名的.db-journal文件,不明白此文件的用途,于是 google了sql ...

  10. Hibernate自动建表问题

    自动见表配置 <property key="hibernate.hbm2ddl.auto">update</property> 运行时出现了一下错误 org ...