Solved

detect IMEI number

Posted on 2006-11-17
3
1,413 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the most popular question in our Windows Mobile Programming zone is about the backlight - we all want to keep it on when our application is running. Few years ago the function SystemIdleTimerReset() did this job. On our side we had to detec…
Once again I push the limits of my phone.  An introduction to the Android Google Now Launcher.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

896 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

14 Experts available now in Live!

Get 1:1 Help Now