WINCE 获取智能设备唯一编号
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 获取智能设备唯一编号的更多相关文章
- iOS获取设备唯一编号,就算删除app从新安装也不变的方法
第三方开源代码 https://github.com/soffes/SAMKeychain 使用方法 //获取设备信息32 位字符串 -(NSString *)getDeviceString{ NSS ...
- Mysql表中唯一编号的分配机制
最近遇到一个问题:高并发环境下,如何避免MYSQL一张表里的某些列不要重复. 同其他博友一样 https://blog.csdn.net/jacketinsysu/article/details/51 ...
- iOS 获取设备唯一标示符的方法
在开发中会遇到应用需要记录设备标示,即使应用卸载后再安装也可重新识别的情况,在这写一种实现方式--读取设备的UUID(Universally Unique Identifier)并通过KeyChain ...
- iOS获取设备唯一标识的8种方法
8种iOS获取设备唯一标识的方法,希望对大家有用. UDID UDID(Unique Device Identifier),iOS 设备的唯一识别码,是一个40位十六进制序列(越狱的设备通过某些工具可 ...
- Android 手机上获取物理唯一标识码[转]
所有添加有谷歌账户的设备可以返回一个 ANDROID_ID 所有的CDMA设备对于 ANDROID_ID 和 TelephonyManager.getDeviceId() 返回相同的值(只要在设置时添 ...
- IOS开发之——OpenUDID的使用获取用户唯一设备
下载网址:https://github.com/ylechelle/OpenUDID OpenUDID测试结果分析 1)优点: a.没有用到MAC地址.MAC地址跟UDID一样,存在隐私问题.不能保证 ...
- 获取设备唯一标识 uuid(采用第三方库SSKeychain)
SSKeyChain 下载链接: http://pan.baidu.com/s/1booV3VD 密码: ivdi /** * 获取设备唯一标识 uuid */ +(NSString*) uuid ...
- ios开发——实用技术篇OC篇&获取设备唯一标识
获取设备唯一标识 WWDC 2013已经闭幕,IOS7 Beta随即发布,界面之难看无以言表...,简直就是山寨Android. 更让IOS程序猿悲催的是,设备唯一标识的MAC Address在IOS ...
- Android获取手机唯一码
大部分安卓手机都可以获取手机唯一码,但是有些手机的厂商却禁止了获取手机唯一码的权限,导致我们不能使用手机唯一码作为标识,但遇到一些必须要填的坑,我们也不能不填,所以使用以下方法来填坑,因此我们使用UU ...
随机推荐
- PRML 术语
第一章 target vector t generalization: Once the model is trained it can then determine the identity of ...
- java.net.SocketException: No buffer space available (maximum connections reached?): JVM_Bind
1. 启动注册表编辑器. HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters 2. 新建 值名称:MaxUser ...
- asp.net LINQ防止SQL注入式攻击
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- Android 4.0 源代码结构
Android源码的第一级目录结构 Android/abi (abi相关代码.ABI:application binary interface,应用程序二进制接口) Android/bioni ...
- XML约束之DTD
XML文件的约束:什么叫约束呢?顾名思义,就是对xml文件的内容进行按照既定规则的限制.我们知道,因为xml文件的标签是可以自定义的,而往往我们用xml文件都是为了表达一定的数据集合(即小型的数据库) ...
- Xcode8不能使用快捷键“command+/”注释代码的解决方法
sudo /usr/libexec/xpccachectl 打开终端,输入该命令(如果电脑有密码的话,会有提示让输入密码) 接下来重启电脑. command + option + / 还可以多行注释
- HR常用事务代码
HR TCODE 描述 PA30 维护人力资源主数据 PA40 人事活动
- Spark standalone HA
配置Spark standalone HA 主机:node1,node2,node3 master: node1,node2 slave:node2,node3 修改配置文件: node1,node3 ...
- Eclipse中调试Android技巧
Android eclipse中程序调试 一:断点调试 用eclipse开发android程序的时,跟VS一样是可以断点单步调试的. 步骤如下. 1 设置断点:在编码窗体的左边框上用鼠标双击,或者右键 ...
- 使用 Sandcastle 生成代码帮助文档
使用 Sandcastle可以生成MSDN风格的帮助文档,生成的帮助文档既可以是chm文档,也可以是MS Help 2.x帮助文档. 1 下载并安装Sandcastle Sandcastle下载地址为 ...