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. 展开、收起div的jQuery代码

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. c++ oop

    C ++语言的主要优势之一是与其前身语言C不同的是,它被设计为支持面向对象编程(OOP). 这是一个相当简单的概念:你将操纵不同的对象,每个对象都是一个特定类的实例. 类是一组方法(绑定到这个类的函数 ...

  3. eclipse maven spring mvc el表达式无效

    http://www.myexception.cn/javascript/2031310.html

  4. PHP 7 Xdebug 深深的坑

    zend_extension 7.0 下的 php.ini 配置 [XDebug];; Only Zend OR (!) XDebugzend_extension=f:\xampp\php\ext\p ...

  5. 模板函数 使用的默认void 模板报错

    You must specify the compiler argument -std=c++0x to avoid the following error: test.cpp:5:13: error ...

  6. Setup Factory 关闭正在运行的程序

    --在全局函数中增加 适用用Setup Factory 9 function FindAndCloseProcessByName(strName)  local tblProcesses = Wind ...

  7. Android "adb devices no permissions"

    列出当前连接设备时出现以下情况 [user@dell platform-tools]# ./adb devices List of devices attached ???????????? no p ...

  8. XSS的原理分析与解剖(转)

    (转)http://netsecurity.51cto.com/art/201408/448305_all.htm 0×01 前言: <xss攻击手法>一开始在互联网上资料并不多(都是现成 ...

  9. 初步认识html以及表格的制作

    12.21,冬至,天空中还下着小雨,雾霾也没有散去,但是也没有冲散节日的气氛,心情也是倍儿好. 今天学习了不少的内容,对我来说是对之前所学的一个巩固,内容比较多也比较杂乱一些,下面以例子的形式来表现: ...

  10. BestCoder Round #90 //div all 大混战 一题滚粗 阶梯博弈,树状数组,高斯消元

    BestCoder Round #90 本次至少暴露出三个知识点爆炸.... A. zz题 按题意copy  Init函数 然后统计就ok B. 博弈 题  不懂  推了半天的SG.....  结果这 ...