²âÊÔÓï·¨¸ßÁÁµÄ C# ´úÂëµÄ html fragment Éú³É
²âÊÔÓï·¨¸ßÁÁµÄ C# ´úÂëµÄ html fragment Éú³É:
ÓÃcsdn blog API ·¢²¼.
ÏÂÃæÊÇ:
public class HtmlWriter
{
static Dictionary _colors;
static int _colorNum;
static StringBuilder _colorString;
///
///
///
///
///
public static string GenerateRtf(TextArea textArea)
{
_colors = new Dictionary();
_colorNum = 0;
_colorString = new StringBuilder();
StringBuilder htmlBuilder = new StringBuilder();
htmlBuilder.AppendLine("");
string fileContent = BuildFileContent(textArea);
//htmlBuilder.Append(@"\viewkind4\uc1\pard");
htmlBuilder.Append(fileContent);
htmlBuilder.AppendLine("");
return htmlBuilder.ToString();
}
static string BuildFileContent(TextArea textArea)
{
StringBuilder htmlBuilder = new StringBuilder();
foreach (ISelection selection in textArea.SelectionManager.SelectionCollection) {
int selectionOffset = textArea.Document.PositionToOffset(selection.StartPosition);
int selectionEndOffset = textArea.Document.PositionToOffset(selection.EndPosition);
Ïà¹ØÎĵµ£º
private void Create_Pz(string Sourcename)
{
string OutMsg;
SqlParameter[] sortPara = { new SqlParameter("@ps_IsType", Pz ......
½üÀ´ORM±äµÃÔ½À´Ô½ÆÕ±é£¬Õâ¶¼¹éÓÚÒ»Öֺܾß˵·þÁ¦µÄÔÒò£»Ëü¿ÉÒÔʹ¿ª·¢Êý¾Ý¿âÇý¶¯µÄÓ¦ÓóÌÐò±äµÃ¸ü¿ì¡¢¸üÊ¡Á¦¡£µ«ÊÇORM¿ò¼Ü¶¼Óе㓹ÌÖ´¼º¼û”£¬ËûÃÇÆÚÍû¿ª·¢Õß×ñ´ÓÌØ¶¨µÄ¹æÔò£¬µ±¹æÔò±»´òÆÆµÄʱºò¾Í·Ç³£ÄÑÒÔʹÓá£×îͨ³£µÄ¹æÔòÖ®Ò»¾ÍÊÇ£¬´æ´¢¹ý³Ì±ØÐë×ÜÊÇ·µ»Øµ¥¶ÀµÄ½á¹û¼¯£¬ÆäÖд ......
³£ÓÃÌæ»» JS(trim,ltrim,rtrim)ºÍÌæ»»HTML±êÇ©
http://hi.baidu.com/sunsonruby/blog/item/e1bd76d5cc0efec751da4bc9.html
http://sxpyrgz.javaeye.com/blog/397470
<html>
<head>
<title>ÖйúÕ¾³¤Ìì¿Õ-ÍøÒ³ÌØÐ§-±íµ¥ÌØÐ§-Ö»ÄÜÊäÈëÖÐÎĵÄÎı¾¿ò</title>
<meta http-equiv="content-Type" ......
http://localhost:8080/tj16/
"/"´ú±í¸ùĿ¼£¬"./" ´ú±íµ±Ç°Ä¿Â¼£¬"../"´ú±íÉϼ¶Ä¿Â¼¡£
·þÎñÆ÷¶ËµÄÏà¶ÔµØÖ·Ö¸µÄÊÇÏà¶ÔÓÚÄãµÄwebÓ¦ÓõĵØÖ·£¬ÊÇÔÚ·þÎñÆ÷¶Ë½âÎöµÄ¡£(http://localhost:8080/tj16/)
htmlÒ³ÃæÖеÄÏà¶ÔµØÖ·¶¼ÊÇÏà¶ÔÓÚ·þÎñÆ÷¸ùĿ¼£¬Êǿͻ§¶Ëä¯ÀÀÆ÷½âÎöµÄ¡£(http://localhost:8080/)
webapp tj16
i:/test/t ......
HtmlÖÐLabel±ê¼ÇµÄ×÷ÓúÍʹÓýéÉÜ
Label±êʶÓÐÁ½¸öÊôÐÔ£¬Ò»¸öÊÇFOR£¬Ò»¸öÊÇACCESSKEY¡£
FORµÄÒâ˼ÊÇ£¬Õâ¸öLableÊÇΪÄĸö¿Ø¼þ·þÎñµÄ£»
ACCESSKEYÔò¶¨ÒåÁË·ÃÎÊÕâ¸ö¿Ø¼þµÄÈȼü¡£
±ÈÈ磬ÓÐÒ»¸öÃû×Ö½ÐNameµÄÎı¾¿ò£¬<INPUT TYPE="TEXT" ID="Name" SIZE=30>£¬
ÄÇô£¬<label>¾Í¿ÉÒÔ¶¨Òå³É£º<LABEL FOR="Nam ......