private void copyButton_Click(object sender, EventArgs e) { Form1 form = (Form1)Owner; Clipboard.SetDataObject(fileName, true, ConstantUtil.clipboardRetryTimes, ConstantUtil.clipboardRetryDelay); ClipboardManager.AddContent(form); }
private void ClipboardData(Form1 form) { String textToClipboard = String.Empty; textToClipboard += usernameLabel1.Text + " " + usernameLabel.Text + Environment.NewLine; textToClipboard += domainLabel1.Text + " " + domainLabel.Text + Environment.NewLine; textToClipboard += workingDirectoryLabel1.Text + " " + ConstantUtil.ApplicationExecutionPath() + Environment.NewLine; textToClipboard += machineNameLabel1.Text + " " + machineNameLabel.Text + Environment.NewLine; textToClipboard += osLabel1.Text + " " + osLabel.Text + Environment.NewLine; textToClipboard += processorsLabel1.Text + " " + processorsLabel.Text + Environment.NewLine; textToClipboard += frameworkVersionLabel1.Text + " " + frameworkVersionLabel.Text + Environment.NewLine; textToClipboard += memoryLabel1.Text + " " + memoryLabel.Text + Environment.NewLine; Clipboard.SetDataObject(textToClipboard, true, ConstantUtil.clipboardRetryTimes, ConstantUtil.clipboardRetryDelay); ClipboardManager.AddContent(form); }