有一种方法可以完成这个任务。
多亏了Simon的博客文章(http://blog.victornet.de/2011/04/10/c-manzana-iphoneipad-hausarrest/)和一些邮件交流,最终我成功了。
现在我正在使用Manzana,并且采用了Simon的扩展:
MobileDevice.AMDeviceStartHouseArrestService(iPhoneHandle,
MobileDevice.CFStringMakeConstantString(bundleIdentifier), null, ref hService, 0);
通过指定应用程序的bundleIdentifier启动“Housearrest”可以使其“/文档”文件夹可以通过默认的Manzana方法访问。因此,无需越狱iDevice。最终,我能够将文件推送到iDevice并读取它们。
再次感谢Simon的大力支持!
我不太确定你在问什么。如果你想访问iPad上的标准文件,它可以被设置为USB大容量存储设备。我相信标准IO方法(System.IO)将能够读写设备,如果你传入正确的路径。如果你是在谈论访问应用程序文件,由于iOS的安全问题,我不认为这是可能的(至少不是以标准、非越狱的方式)。
string pathOnDevice = @"/Documents/somefilename.ext"; ... public bool readFromDevice(string targetPath) { if (_myIP.ReConnect("com.bundle.identifier")) Console.WriteLine("## Some debug output"); else return false; _myIP.getFile(_myIP, pathOnDevice, targetPath); return true; }- phhe