Solved

detect IMEI number

Posted on 2006-11-17
3
1,409 Views
Last Modified: 2013-11-18
i need to find the imei number proramatically, possible? if so how? I'm using VS 2005 and VB
0
Comment
Question by:str_kani
  • 2
3 Comments
 
LVL 12

Author Comment

by:str_kani
ID: 17967512
windows 2003 mobile.
0
 
LVL 5

Accepted Solution

by:
CraigTheGeek earned 500 total points
ID: 17979826
0
 
LVL 12

Author Comment

by:str_kani
ID: 18067551
here is the working code...


Dim t As New OpenNETCF.Tapi.Tapi
            t.Initialize()

            Dim l As OpenNETCF.Tapi.Line = t.CreateLine(0, OpenNETCF.Tapi.LINEMEDIAMODE.INTERACTIVEVOICE,

OpenNETCF.Tapi.LINECALLPRIVILEGE.MONITOR)

            Dim lgi As New GeneralInfo

            Dim buffer(512) As Byte
            'write size
            BitConverter.GetBytes(512).CopyTo(buffer, 0)

            If lineGetGeneralInfo(l.hLine, buffer) <> 0 Then
                Throw New System.ComponentModel.Win32Exception(System.Runtime.InteropServices.Marshal.GetLastWin32Error(), "TAPI

Error: " + System.Runtime.InteropServices.Marshal.GetLastWin32Error().ToString("X"))
            End If

            Dim serialsize As Integer = BitConverter.ToInt32(buffer, 36)
            Dim serialoffset As Integer = BitConverter.ToInt32(buffer, 40)
            lgi.SerialNumber = System.Text.Encoding.Unicode.GetString(buffer, serialoffset, serialsize)
            lgi.SerialNumber = lgi.SerialNumber.Substring(0, lgi.SerialNumber.IndexOf(Chr(0)))

            ' Dim gi As GeneralInfo = GetGeneralInfo(l)
            'lblManufacturer.Text = gi.Manufacturer
            'lblModel.Text = gi.Model
            ' lblRevision.Text = gi.Revision
            ' lblSubscriber.Text = gi.SubscriberNumber
            l.Dispose()
            t.Shutdown()
            Return lgi.SerialNumber



0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A short article about problems I had with the new location API and permissions in Marshmallow
You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now