Solved

detect IMEI number

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Samsung Galaxy Ace Emails not visible in Inbox 2 80
ActionBar problem 7 144
TextBelt send file contents 20 118
How do i get a video to play smoothly on a mobile phone? 5 69
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 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