| 
 | 
 
-  public static void Execute(Dictionary<string, string> stringDic,Dictionary<string, List<string>> listDic, Dictionary<string, int> intDic)
 
  
-         {
 
  
-  System.Windows.Forms.Clipboard.SetText(stringDic["文件集"]);
 
  
-         }
 
  复制代码 
c#把变量写入剪贴板  
- System.Windows.Forms.Clipboard.SetText(stringDic["文件集"]);
 
  复制代码 
 
单步测试正常 
打包时或测试运行时出错  
 
 
运行C#代码:编译出错:调用的目标发生了异常。在可以调用 OLE 之前,必须将当前线程设置为单线程单元(STA)模式。请确保您的 Main 函数带有 STAThreadAttribute 标记。 
 
怎么解决 
 |   
 
 
 
 |