1原来的效果
//原-来′得?rft字?符?(vs向ò剪?贴ù板?写′数y据Y时±出?现?多à余à的?元a字?符?,不?知a道à原-因ò,求ó解a....) string rtf = (string)Clipboard.GetData(DataFormats.Rtf); #region 输?出?测a试? //var frm = new frmTextbox(); //frm.SetText(rtf); //frm.ShowDialog(); #endregion //字?符?串? rtf = System.Text.RegularExpressions.Regex.Replace(rtf, @"\\uinput2(?<uc>\\u-?\d*)\s..", (m) => { return m.Groups["uc"].Value + "?"; }); newContent = "<pre class=\"code\">" + Undent(HTMLRootProcessor.FromRTF(rtf)) + ""; return DialogResult.OK;
2现在的效果
if (Clipboard.ContainsData(DataFormats.Rtf)) { //原来得rft字符(vs向剪贴板写数据时出现多余的元字符,不知道原因,求解....) string rtf = (string)Clipboard.GetData(DataFormats.Rtf); #region 输出测试 //var frm = new frmTextbox(); //frm.SetText(rtf); //frm.ShowDialog(); #endregion //字符串 rtf = System.Text.RegularExpressions.Regex.Replace(rtf, @"\\uinput2(?<uc>\\u-?\d*)\s..", (m) => { return m.Groups["uc"].Value + "?"; }); newContent = "<pre class=\"code\">" + Undent(HTMLRootProcessor.FromRTF(rtf)) + ""; return DialogResult.OK; }源代码:下载地址
生成DLL:下载地址
转载请注明:http://www.cnblogs.com/Rolends
HAPPY EVERY DAY ! !