0

有谁知道是否可以使用 读取/编辑 iPhone 的联系人列表C#,假设 iPhone 是通过 USB 电缆/iTunes 插入 Windows PC 的?

4

2 回答 2

0

您可以使用 CFManzana / Manaza 或 MobileDevice dll 来连接 iPhone。下面是一个如何做到这一点的例子。

// this variable will be declared in your class .

public static string devicename;

CFManzana.iDevice
phone = New iDevice();
phone.connect += phone_connect;

void phone_connect(object sender, ConnectEventArgs args)
        {
// here your will add your exception handling details.
           }

// now extract your device details.

devicename = phone.getDeviceName or phone.CopyValue("DeviceName"); \\it all depends what version of Manzana you have downloaded.

//now assign the value to the field 

this.txtname.text = devicename;

于 2013-01-17T11:27:22.487 回答
0

如果你想通过 USB 从 Windows 连接到 iOS 设备,你可以尝试我维护的 imobiledevice-net NuGet 包。例如,要列出当前连接到您的 PC 的所有 iOS 设备,您可以这样做:

ReadOnlyCollection<string> udids;
int count = 0;

var idevice = LibiMobileDevice.Instance.iDevice;
var lockdown = LibiMobileDevice.Instance.Lockdown;

var ret = idevice.idevice_get_device_list(out udids, ref count);

if (ret == iDeviceError.NoDevice)
{
    // Not actually an error in our case
    return;
}

ret.ThrowOnError();

// Get the device name
foreach (var udid in udids)
{
    iDeviceHandle deviceHandle;
    idevice.idevice_new(out deviceHandle, udid).ThrowOnError();

    LockdownClientHandle lockdownHandle;
    lockdown.lockdownd_client_new_with_handshake(deviceHandle, out lockdownHandle, "Quamotion").ThrowOnError();

    string deviceName;
    lockdown.lockdownd_get_device_name(lockdownHandle, out deviceName).ThrowOnError();

    deviceHandle.Dispose();
    lockdownHandle.Dispose();
}
于 2017-11-09T18:32:50.800 回答