易截截图软件、单文件、免安装、纯绿色、仅160KB

字符串截取(包括html,BasicPage.cs类使用)

    /// <summary>
    /// 截断字符串(中文计一个字符宽度,其它计半个字符宽度)
    /// </summary>
    /// <param name="input">需截断的字符串</param>
    /// <param name="length">字符宽度</param>
    /// <returns>截断字符串(带"...")</returns>
    protected string truncatedChars(string input, int length)
    {
        input = Server.HtmlEncode(input);
        if (input.Length > length)
        {
            int pos = 0;
            string result = "";
 
            foreach (char chr in input)
            {
                if (Regex.IsMatch(chr.ToString(), "[^\x00-\xff]"))
                {
                    pos += 2;
                }
                else
                {
                    pos += 1;
                }
                result += chr.To


相关文档:

ASP.NET 清除 HTML 标记函数

using System.Text.RegularExpressions;   //引入的命名空间
以下为引用的内容:
//清除HTML函数
    public static string NoHTML(string Htmlstring)
    {
        //删除脚本
        Htmlstr ......

javascript之HTML(select option)详解

一、基础理解:
var e = document.getElementById("selectId");
e. options= new Option("文本","值") ;
//创建一个option对象,即在<select>标签中创建一个或多个<option value="值">文本</option>
//options是个数组,里面可以存放多个<option value="值">文本</option>这样的标签
1:opt ......

去除字符串中的Html代码

        /// <summary>
        /// 去掉所有HTML标签
        /// </summary>
        /// <param name="strHtml">源字符串</param> ......

FCKeditor提交失败返回内容变html的解决方法

在FckEditor.Net 2.64和asp.net 2.0的环境下发现如下问题:如果浏览器执行返回动作,FckEditor编辑框内显示html代码:
  解决方法是:修改文件FCKEditor\editor\fckeditor.html,在window.onload = function()的函数第一行添加
  FCK.LinkedField.value=FCKTools.HTMLDecode(FCK.LinkedField.value);
  如果问题不 ......

关于在html页面中创建fckeditor

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>文本编辑器</title>
     <meta http-equiv="C ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号