Ejemplo n.º 1
0
        public unsafe int GetiphoneSize()
        {
            void *dict = null;
            int   num  = 0;

            if ((MobileDevice.AFCDeviceInfoOpen(this.hAFC, ref dict) == 0) && (dict != null))
            {
                num = *((int *)dict);
            }
            return(num);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取设备所有信息
        /// </summary>
        /// <returns>Dictionary集合,第一个参数为键,第二个参数为键值</returns>
        public unsafe Dictionary <string, string> GetDeviceInfo()
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();
            void *dict = null;

            if ((MobileDevice.AFCDeviceInfoOpen(this.hAFC, ref dict) == 0) && (dict != null))
            {
                void *voidPtr2;
                void *voidPtr3;
                while (((MobileDevice.AFCKeyValueRead(dict, out voidPtr2, out voidPtr3) == 0) && (voidPtr2 != null)) && (voidPtr3 != null))
                {
                    string key  = Marshal.PtrToStringAnsi(new IntPtr(voidPtr2));
                    string str2 = Marshal.PtrToStringAnsi(new IntPtr(voidPtr3));
                    dictionary.Add(key, str2);
                }
                MobileDevice.AFCKeyValueClose(dict);
            }
            return(dictionary);
        }