首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >摩托罗拉MC55唯一ID

摩托罗拉MC55唯一ID
EN

Stack Overflow用户
提问于 2011-09-20 17:10:51
回答 2查看 407关注 0票数 0

在摩托罗拉MC55中,我想要获得扫描仪的工厂或唯一id或序列号。如何在vb.net中编码?

EN

回答 2

Stack Overflow用户

发布于 2011-09-20 17:30:55

因为它是一种移动设备,所以它将有一个IMEI编号,那么这又如何?您可以使用ATD*#06#AT++CGSN检索它。

票数 0
EN

Stack Overflow用户

发布于 2016-09-08 15:46:18

您可以使用P/Invoke来获取设备的DeviceUniqueID

代码语言:javascript
复制
 //DeviceID for Win Mobile >= 5.0
    [DllImport("coredll.dll")]
    private extern static int GetDeviceUniqueID([In, Out] byte[] appdata, int cbApplictionData, int dwDeviceIDVersion,
                                                [In, Out] byte[] deviceIDOuput, out uint pcbDeviceIDOutput);




  private static string getDeviceID()
    {
            string appString = "Your App Name";
            byte[] appData = new byte[appString.Length];
            for (int count = 0; count < appString.Length; count++)
            {
                appData[count] = (byte)appString[count];
            }

            int appDataSize = appData.Length;
            byte[] DeviceOutput = new byte[20];
            uint SizeOut = 20;
            GetDeviceUniqueID(appData, appDataSize, 1, DeviceOutput, out SizeOut);

            string idString = "";
            for (int i = 0; i < DeviceOutput.Length; i++)
            {
                if (i == 4 || i == 6 || i == 8 || i == 10)
                    idString = String.Format("{0}-{1}", idString, DeviceOutput[i].ToString("x2"));
                else
                    idString = String.Format("{0}{1}", idString, DeviceOutput[i].ToString("x2"));
            }
            return idString;

    }

编辑:注意这是一个C#解决方案抱歉一开始我没有看到你想要VB解决方案,但是对于任何想要C#解决方案的人来说,这对你来说应该是有效的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7482745

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档