2013-07-22 5 views

Répondre

2

Voici un exemple simple de copier et de coller une chaîne:

private static string[] pboardTypes = new string[] { "NSStringPboardType" }; 

public static void SetText(string text) 
{ 
    NSPasteboard.GeneralPasteboard.DeclareTypes(pboardTypes, null); 
    NSPasteboard.GeneralPasteboard.SetStringForType(text, pboardTypes[0]); 
} 

public static string GetText() 
{ 
    return NSPasteboard.GeneralPasteboard.GetStringForType(pboardTypes[0]); 
} 
+0

Cela fonctionne avec d'autres programmes, non? (même si merci!) – shmuelie

+0

Ça devrait bien fonctionner – TheNextman

Questions connexes