简体   繁体   English

如何使用C#访问iOS App的Documents文件夹

[英]How can I access Documents folder of iOS App with C#

I want to push a file from Windows (c#) to an iPad and get it back later. 我想将一个文件从Windows(c#)推送到iPad并稍后再回来。 I have no Network connection so I need to do this via USB cable. 我没有网络连接所以我需要通过USB线做到这一点。

I have found Manzana but seems not to support iTunes FileSharing. 我找到了Manzana,但似乎不支持iTunes FileSharing。

Any hints ? 任何提示? I googled a lot but couldn't find anything useful. 我google了很多但找不到任何有用的东西。

There are some functions like "AMDeviceStartHouseArrest" but I don't know how to use them to get my Files. 有一些功能,如“AMDeviceStartHouseArrest”,但我不知道如何使用它们来获取我的文件。

There is a way to get this done. 有一种方法可以完成这项工作。

Thanks to a blogpost from Simon (http://blog.victornet.de/2011/04/10/c-manzana-iphoneipad-hausarrest/) and some Mails it finally worked. 感谢Simon的博客文章(http://blog.victornet.de/2011/04/10/c-manzana-iphoneipad-hausarrest/)和一些邮件,它终于奏效了。

I'm now using Manzana with the expansion from Simon: 我现在正在使用Manzana来扩展Simon:

MobileDevice.AMDeviceStartHouseArrestService(iPhoneHandle,      
MobileDevice.CFStringMakeConstantString(bundleIdentifier), null, ref hService, 0);

Starting the 'Housearrest' for a specific App (by bundleIdentifier) makes its '/Documents' Folder accessible via the default Manzana methods. 启动特定应用程序的“Housearrest”(通过bundleIdentifier)可以通过默认的Manzana方法访问其“/ Documents”文件夹。 So there is no need for jailbreaking the iDevice. 所以没有必要越狱iDevice。 Finally I'm able to push files to the iDevice and read them back. 最后,我能够将文件推送到iDevice并将其读回。

Thanks again to Simon for the great support! 再次感谢西蒙的大力支持!

Im not quite sure what you are asking. 我不太确定你在问什么。 If you want to access standard files on an ipad, it can be set as a USB mass storage device. 如果要访问ipad上的标准文件,可以将其设置为USB大容量存储设备。 I believe the standard IO methods (System.IO) would then be able to read and write to the device, if you pass in the correct path. 我相信标准IO方法(System.IO)将能够读取和写入设备,如果您传入正确的路径。 If you are talking about accessing an applications files, I do not believe this is possible due to security concerns with iOS (at least not in a standard, non-jailbroken way) 如果您正在谈论访问应用程序文件,我认为这不可能由于iOS的安全问题(至少不是标准的,非越狱的方式)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何访问“文档和设置”文件夹? - How can I access the "Documents and Settings" folder? 如何使用c#从外部应用程序访问特定文件夹中的Outlook 2013联系人? - How can I access Outlook 2013 contacts in a certain folder from an external app using c#? 拒绝访问 C# 中的“文档”(以及几乎所有其他文件夹) - Access Denied to "Documents" in C# (and pretty much any other folder) 如何避免使用c#在Mongodb中复制文档 - how can I avoid duplicating documents in Mongodb using c# 如何移动到另一个文件夹以访问 C# 中的其他文件 - How can I move into another folder to access other files in C# 如何在 C# 中创建“递归”文件夹和子文件夹 - How can i create "recursively" folder and sub folder in C# 我如何给我的应用程序数据文件夹卡巴斯基像安全一样? - c# How can I give my app data folder Kaspersky like security? 如何在不使用C#刷新应用程序的情况下动态读取文件夹中的XML文件? - How can I dynamically read XML files in a folder without refreshing my app using C#? 如何在Xamarin中将Google的API用于使用C#(而非Obj-C)的iOS应用 - How can I use Google's API in Xamarin for an iOS app using C# (not Obj-C) 如何使用C#访问SQLite? - How can I access SQLite with C#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM