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

Asp.net 长文章分页

public string NoHTML(string Htmlstring) //去除HTML标记
{
//删除脚本
Htmlstring = Regex.Replace(Htmlstring, @" <script[^>]*?>.*? </script>", "", RegexOptions.IgnoreCase);
//删除HTML
Htmlstring = Regex.Replace(Htmlstring, @" <(.[^>]*)>", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"([\r\n])[\s]+", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"-->", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @" <!--.*", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"&(quot|#34);", "\"", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"&(amp|#38);", "&", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"&(lt|#60);", " <", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"&(gt|#62);", ">", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"&(nbsp|#160);", " ", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"&(iexcl|#161);", "\xa1", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"&(cent|#162);", "\xa2", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"&(pound|#163);", "\xa3", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"&(copy|#169);", "\xa9", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"&#(\d+);", "", RegexOptions.IgnoreCase);
Htmlstring.Replace(" <", "");
Htmlstring.Replace(">", "");
Htmlstring.Replace("\r\n", "");
Htmlstring = HttpContext.Current.Server.HtmlEncode(Htmlstring).Trim();
return Htmlstring;
}
public string OutputBySize(string p_strContent)//分页函数
{
string m_strRet = "";
int m_intPageSize = 2500;//文章每页大小
int m_intCurrentPage = 1;//设置第一页为初始页
int m_intTotalPage = 0;
int m_intArticlelength = NoHTML(p_strContent).Length;//文章长度
if (m_intPageSize &


相关文档:

Asp.net实用技巧新窗口中打开页面API


1.在新窗口中打开页面
   
我们经常需要在点击某个Button的时候打开一个新的页面,而且由于应用的需要,我们又不能使用超级连接或者LinkButton来代替这个
Button,于是我们只有在Button的Click事件中进行新页面的打开工作。我将这个工作封装成一个API,如下:
 1
OpenWindowInNewPage
#region ......

ASP.NET

      使用 ASP.NET 按钮 Web 服务器控件可使用户能够将页发送到服务器并触发页上的事件。
一、背景
可使用 Button Web 服务器控件为用户提供向服务器发送页的能力。该控件会在服务器代码中触发一个事件,您可以处理该事件来响应回发。例如,用户可以指示已完成表单或希望执行特定的命令。
AS ......

asp.net 图片上传

 protected void Button1_Click(object sender, EventArgs e)
    {
      
        string fullName = this.File1.PostedFile.FileName;//获取上传文件的全路径
        string size = th ......

ASP.NET页面的CheckBoxList组件

CheckBox选择组件是一个程序中都经常的组件。在程序设计中使用到该组件,一般都不会只使用到一个,往往是以多个此类组件的形式出现的。在ASP.NET页面中如果要使用到多个CheckBox组件,除了添加多个CheckBox组件在页面中之外,还有一种比较方便的方法,就是使用CheckBoxList 组件。CheckBoxList组件是由一组的CheckBox组件组 ......

ASP.NET文件下载函数使用浅析

ASP.NET文件下载函数使用是什么情况呢?在你的Page_Load中添加这样的代码:
Page.Response.Clear();
bool success = ResponseFile(Page.Request, Page.Response, "目的文件名称", @"源文件路径", 1024000);
if (!success) Response.Write("下载文件出错!"); Page.Response.End();
ASP.NET文件下载函数代码为:
publi ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号