In a very interesting open-source VS2005 plug-in: CopySourceAsHtml, You can see CopySourceAsHtml, and install VS2005 in Chinese. In addition, it is open-source, the solution that can be found in the Bug that the CopySourceAsHTML plug-in cannot be used in Chinese VS2005 is fixed ,.
I have also modified some of the settings, and added the background color of adjacent rows,
And make some modifications that you think you need. The modified DLL can be downloaded here: CopySourceAsHtml. dll.
Add a style sheet: The. cf style comes from Dflying Chen's blog.
Style example:/* CopySourceAsHtml Style */
. Cf {
Font-family: consolas, "Courier New", courier, monospace;
Font-size: 1.2em;
Color: black;
Background-color: # fff;
Line-height: 1em;
/* White-space: pre ;*/
}
. Cf p. cl {margin: 0; padding: 0;}/* Common row */
. Cf p. cl_alt {margin: 0; padding: 0; background-color: # f4f4f4;}/* adjacent row */
. Cln {color: # 2b91af;}/* row number */
. Cb_green {color: green;}/* by color */
. Cb_blue {color: blue ;}
. Cb_2b91af {color: # 2b91af ;}
. Cb_a31515 {color: # a31515 ;}
. Cb_red {color: red ;}
Example:
Without line number:
Public static void SetHtml (string html)
{
DataObject data;
Data = new DataObject ();
Data. SetData (DataFormats. Text, true, html );
// Data. SetData (DataFormats. UnicodeText, true, html );
Data. SetData (DataFormats. Html, true, EncodeHtml (html ));
// MessageBox. Show (data. GetText (TextDataFormat. Html ));
System. Windows. Forms. Clipboard. SetDataObject (data, true );
}
With row number:
34 public static void SetHtml (string html)
35 {
36
37. DataObject data;
38
39 data = new DataObject ();
40 data. SetData (DataFormats. Text, true, html );
41 // data. SetData (DataFormats. UnicodeText, true, html );
42 data. SetData (DataFormats. Html, true, EncodeHtml (html ));
43 // MessageBox. Show (data. GetText (TextDataFormat. Html ));
44 System. Windows. Forms. Clipboard. SetDataObject (data, true );
45
46}
I hope Dflying Chen can copy his style.