asp.net清除html标记
#region 清除文本样式 主要应用于从网络粘贴进来的文本
[WebMethod]
public static string ClearStyle(string yourStr)//清除样式
{
ImageUrl = null;
string OldString = yourStr;
StringBuilder UpdateString = new StringBuilder();
Regex reg = new Regex(@"(?i)<img[^>]*?\s*src=(['""]?)(?<src>[^'""\s>]+)\1[^>]*>");//匹配出img标记
MatchCollection mc = reg.Matches(yourStr);
int imgsum = mc.Count;
ImageUrl = new string[imgsum];
if (imgsum > 0)
{
for (int i = 0; i < imgsum; i++)
{
int len = mc[i].Length;
int index = OldString.IndexOf(mc[i].ToString());
string indextext = OldString.Substring(0, index);
&nbs
相关文档:
个人觉得这是标准与私有标准的PK, 就像微软的office和其他office软件,如金山wps,openoffice的竞争类似。
从用户角度看PK越多越好,呵呵。
http://www.javaeye.com/news/15856-apple-flash
http://www.w3school.com.cn/html5/index.asp
http://www.w3.org/TR/html5/
http://html5.org/ ......
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Sy ......
1.采用流取得图片大小
Stream stream=file.PostedFile.InputStream;
System.Drawing.Image image=System.Drawing.Image.fromStream(stream);
Image.Width
Image.Height
2.使用文件得到图片大小
System.Drawing.Image image=System.Drawing.Image.fromFile(图片路径)
Image.Width
Image.Height ......
Html是否是标准文档往往影响js的执行效果。 比如:在IE6下 document.documentElement.clientHeight 这个函数是获取可视窗口文档高度,如果html不是标准文档 则返回值是零.而document.body.clientHeight 能返回相应的值.相反如果是标准文档 document.body.clientHeight 返回值是0;
类似的还有document.documentElemen ......
DataGridView 72计
本文将介绍ASP.NET中DataGridView的用法,DataGridView在Asp.net中是常用的控件之一,掌握好DataGridView的特点和用法。将对程序的性能有大大的提高,同时也能加快我们项目的开发周期!
快速预览:
GridView无代码分页排序
GridView选中,编辑,取消,删除
GridView正反双向排序
GridView和下拉菜单 ......