الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

Imei, Imsi, Model, Revision, Memorydiagnostics .........

مغلق
بدأه بن العيد في 21 يناير 2008 · 4 رد · 2,037 مشاهدة · في برمجة الأجهزة الكفية والمحمولة بالدوت نيت
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

post-91400-1200925630_thumb.jpg

معطيات إضافية حول الهاتف ومستعمله

المعرف العالمي للجهاز النقال ( International Mobile Equipment Identity ( IMEI

تتابع رقمي من 15-خانة يتم اسناده الى الجهاز النقال في طور التصنيع (رقم فريد لكل جهاز )

في كل شبكة GSM يوجد قسم يسمى ( Equipment Identity Register (EIR وهو قاعدة بيانات تخزن قائمة بأرقام IMEI للأجهزة الجوالة المرخصة على الشبكة حيث ان هذا المعرف يجري تعريفه في EIR بأنه غير مرخص اذا بلغ ان الجهاز مسروق أو لأسباب أمنية .

المعرف العالمي للمشترك المتنقل ( [International Mobile Subscriber Identity ( IMSI

تتابع رقمي من 15-خانة مخزن في بطاقة الSIM يمثل رقم الهاتف وهو مهم في عملية الارسال والاستقبال الراديوي حيث يتم ربطه بالاشارة الحاملة الخاصة بالمستخدم حيث يتعرف النظام الى المشتركين عبر هذا المعرف .

ومعطيات أخرى مثل manufacture, model, revision

 </div>[code]<div class="codemain"> public void details()
					{
						IntPtr hLine;
						int dwNumDev;
						int num1 = 0x20000;
						LINEINITIALIZEEXPARAMS lineInitializeParams = new LINEINITIALIZEEXPARAMS();
						lineInitializeParams.dwTotalSize = (uint)Marshal.SizeOf(lineInitializeParams);
						lineInitializeParams.dwNeededSize = lineInitializeParams.dwTotalSize;
						lineInitializeParams.dwOptions = 2;
						lineInitializeParams.hEvent = IntPtr.Zero;
						lineInitializeParams.hCompletionPort = IntPtr.Zero;

						// lineInitializeEx
						 int result = Tapi.lineInitializeEx(out hLine, IntPtr.Zero, IntPtr.Zero,  null, out dwNumDev, ref num1, ref lineInitializeParams);

						if (result != 0)
						{
							MessageBox.Show(string.Format("lineInitializeEx failed!\n\nError Code:{0}", result.ToString()));
							this.Close();
							return;
						}

						// lineNegotiateAPIVerison
						int version;
						int dwAPIVersionLow = 0x10004;
						int dwAPIVersionHigh = 0x20000;
						LINEEXTENSIONID lineExtensionID;
						 result = Tapi.lineNegotiateAPIVersion(hLine, 0, dwAPIVersionLow,  dwAPIVersionHigh, out version, out lineExtensionID);
						// navigation failed
						if (result != 0)
						{
							 MessageBox.Show(string.Format("lineNegotiateAPIVersion failed!\n\nError  Code: {0}", result.ToString()));
							this.Close();
							return;
						}

						// lineOpen
						IntPtr hLine2 = IntPtr.Zero;
						result = Tapi.lineOpen(hLine, 0, out hLine2, version, 0, IntPtr.Zero, 0x00000002, 0x00000004, IntPtr.Zero);
						// lineOpen failed
						if (result != 0)
						{
							 MessageBox.Show(string.Format("lineNegotiateAPIVersion failed!\n\nError  Code: {0}", result.ToString()));
							this.Close();
							return;
						}

						// lineGetGeneralInfo
						int structSize = Marshal.SizeOf(new LINEGENERALINFO());
						byte[] bytes = new byte[structSize];
						byte[] tmpBytes = BitConverter.GetBytes(structSize);

						for (int index = 0; index < tmpBytes.Length; index++)
						{ bytes[index] = tmpBytes[index]; }

						// make initial query to retrieve necessary size
						result = Tapi.lineGetGeneralInfo(hLine2, bytes);

						// get the needed size
						int neededSize = BitConverter.ToInt32(bytes, 4);

						// resize the array
						bytes = new byte[neededSize];

						// write out the new allocated size to the byte stream
						tmpBytes = BitConverter.GetBytes(neededSize);
						for (int index = 0; index < tmpBytes.Length; index++)
						{ bytes[index] = tmpBytes[index]; }

						// fetch the information with properly size buffer
						result = Tapi.lineGetGeneralInfo(hLine2, bytes);

						if (result != 0)
						{
							MessageBox.Show(Marshal.GetLastWin32Error().ToString());
							this.Close();
							return;
						}

						int size;
						int offset;
						// Now all the required information are stored in the variable "bytes"
						//  which we well have to parse.

						// manufacture
						size = BitConverter.ToInt32(bytes, 12);
						offset = BitConverter.ToInt32(bytes, 16);
						manufacture = Encoding.Unicode.GetString(bytes, offset, size);
						manufacture = manufacture.Substring(0, manufacture.IndexOf(''));

						// model
						size = BitConverter.ToInt32(bytes, 20);
						offset = BitConverter.ToInt32(bytes, 24);
						model = Encoding.Unicode.GetString(bytes, offset, size);
						model = model.Substring(0, model.IndexOf(''));

						// revision
						size = BitConverter.ToInt32(bytes, 28);
						offset = BitConverter.ToInt32(bytes, 32);
						revision = Encoding.Unicode.GetString(bytes, offset, size);
						revision = revision.Substring(0, revision.IndexOf(''));

						// serial number
						size = BitConverter.ToInt32(bytes, 36);
						offset = BitConverter.ToInt32(bytes, 40);
						serialNumber = Encoding.Unicode.GetString(bytes, offset, size);
						serialNumber = serialNumber.Substring(0, serialNumber.IndexOf(''));

						// subscriber id
						size = BitConverter.ToInt32(bytes, 44);
						offset = BitConverter.ToInt32(bytes, 48);
						subscriberID = Encoding.Unicode.GetString(bytes, offset, size);
						subscriberID = subscriberID.Substring(0, subscriberID.IndexOf(''));

						// lineClose for hLine2
						Tapi.lineClose(hLine2);

						// lineShutdown for hLine
						Tapi.lineShutdown(hLine);

					}

post-91400-1200926140_thumb.jpg

using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
 using System.Text;
 using System.Runtime.InteropServices;
 using System.Windows.Forms;

 namespace MemorySwitcher
 {
	 public partial class Form1 : Form
	 {
	  public struct MEMORYSTATUS 
   {  public uint Length; 
	  public uint MemoryLoad; 
	  public uint TotalPhys; 
	  public uint AvailPhys; 
	  public uint TotalPageFile; 
	  public uint AvailPageFile; 
	  public uint TotalVirtual; 
	  public uint AvailVirtual; 
   }
	  #region P/Invoke
   [DllImport("CoreDll.Dll")]
   public static extern int GlobalMemoryStatus(ref MEMORYSTATUS ms);
   [DllImport("CoreDll.Dll")]
   public static extern int GetSystemMemoryDivision(ref uint lpdwStorePages, ref uint ldpwRamPages, ref uint ldpwPageSize);
   #endregion

	  public Form1()
	{ InitializeComponent();}

	  private void Form1_Load(object sender, EventArgs e)
		 {
			 uint storePages = 0;
			 uint ramPages = 0;
			 uint pageSize = 0;
			 int res = GetSystemMemoryDivision(ref storePages, ref ramPages, ref pageSize);
			 MEMORYSTATUS MM_Status = new MEMORYSTATUS();
			 GlobalMemoryStatus(ref MM_Status);
			 Store.Items.Add("");
			 Store.Items.Add("Cretical Memory: " + MM_Status.MemoryLoad.ToString());
			 Store.Items.Add("Total Physic: " + MM_Status.TotalPhys.ToString());
			 Store.Items.Add("Available Physical: " + MM_Status.AvailPhys.ToString());
			 Store.Items.Add("Total Page File: " + MM_Status.TotalPageFile.ToString());
			 Store.Items.Add("Available Page File: " + MM_Status.AvailPageFile.ToString());
			 Store.Items.Add("Total Virtual: " + MM_Status.TotalVirtual.ToString());
			 Store.Items.Add("Available Virtual: " + MM_Status.AvailVirtual.ToString());
		 }

	  private void pictureBox1_Click(object sender, EventArgs e)
		 {   Application.Exit();	 }
	 }
 }

...............

#2

شكرا وجزاك الله الف خير !!

وسؤالي هو :- ماهو LINEINITIALIZEEXPARAMS ؟ كيف اضيفه في برنامجي

سبحان الله وبحمده سبحان الله العظيم

#3
 [StructLayout(LayoutKind.Sequential)]
		public struct LINEINITIALIZEEXPARAMS
		{
			public uint dwTotalSize;
			public uint dwNeededSize;
			public uint dwUsedSize;
			public uint dwOptions;
			public System.IntPtr hEvent;
			public System.IntPtr hCompletionPort;
			public uint dwCompletionKey;
		}

ArabteamWMTutorial.zip

#4

شكرا و بارك الله فيك !!

سأجرب واعلمك بالنتيجة .

وشكرا مرة أخرى .

سبحان الله وبحمده سبحان الله العظيم

#5

السلام عليكم

جربته و يعطي Error هو

lineNegotiateAPIVersion failed , error code -2147483601

هل واجهتك هذه المشكلة ؟؟؟ كيف احلها ؟ اهم شي عندي Serial number بنفس الشكل الموجود في الصورة .

ولك جزيل شكرا اخي

سبحان الله وبحمده سبحان الله العظيم

هذا الموضوع مغلق.

مواضيع مشابهة