zoukankan      html  css  js  c++  java
  • C# 数据复制到粘贴板

    using SoftRGB.Controls;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
     
    namespace Yang.Common.Helper
    {
        public static class ClipboardHelper
        {
            /// <summary>
            /// 数据复制到系统粘贴板
            /// add  by yangxp@20180528 
            /// </summary>
            /// <param name="data">待复制数据</param>
            /// <param name="times">尝试次数</param>
            /// <returns>是否成功</returns>
            public static bool  CopyData(string data, int times)
            {
                try
                {
                    bool result = false;
                    if (string.IsNullOrEmpty(data))
                        return false;
                    else
                    {
                        System.Windows.Forms.Clipboard.SetDataObject(data.ToString(), true, 3, 100);
                        result = true;
                    }
                    return result;
                }
                catch (Exception ex)
                {
                    RGBMessageBox.Show("复制失败:剪贴板被其他线程或应用程序占用。
    " + ex.Message, mesBoxType: RGBMesType.Error);
                    return false;
                }
     
            }
        }
    }

    转 :  https://blog.csdn.net/qq_23018459/article/details/80483132

  • 相关阅读:
    循环神经网络(Recurrent Neural Network)
    特征选择
    程序猿能挣多少钱
    python socket
    python 2 encode and decode
    pandas series
    source collection list
    pep8摘要
    python 正则表达式
    django显示图片
  • 原文地址:https://www.cnblogs.com/fps2tao/p/15011277.html
Copyright © 2011-2022 走看看