Example #1
0
        public unsafe bool Exists(string path)
        {
            void *dict = null;
            int   num  = MobileDevice.AFCFileInfoOpen(this.hAFC, path, ref dict);

            if (num == 0)
            {
                MobileDevice.AFCKeyValueClose(dict);
            }
            return(num == 0);
        }
Example #2
0
        public unsafe Dictionary <string, string> GetFileInfo(string path)
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();
            void *dict = null;

            if ((MobileDevice.AFCFileInfoOpen(this.hAFC, path, 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);
        }