测试语法高亮的 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);
相关文档:
=======<html:messages>============
Action 中 :
ActionMessages message = new ActionMessages();
message.add(" 消息句柄 ",new ActionMessage(" 资源文件中 Key 值 ",String 类型描述信息 ));
this.addMessages(request,message);
......
常用替换 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 ......