摘要: 1 /// 2 /// 总记录数 3 /// 每页记录数 4 /// 当前页数 5 /// Url参数 6 private string pagination(int total, int per, int page, string query_string) 7 { 8 int allpage = 0; 9 int next = 0;10 int pre = 0;11 int startcount = 0;12 int endcount = 0;13 ... 阅读全文
posted @ 2013-07-29 15:29 Servant 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 首先下载HtmlAgilityPack 官网:http://htmlagilitypack.codeplex.com/根据自己.net的版本引入dll实现抓取博客园首页文章列表中的标题和地址,代码如下: 1 WebClient wc = new WebClient(); 2 wc.Encoding = System.Text.Encoding.UTF8; 3 string mainData = wc.DownloadString("http://www.cnblogs.com/"); 4 HtmlD... 阅读全文
posted @ 2013-05-07 12:06 Servant 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 写在前面的话我们在使用Ajax时,当我们向服务器发送数据时,我们可以采用Get方式请求服务器,也可以使用Post方式请求服务器.那么,我们什么时候该采用Get方式,什么时候该采用Post方式呢?Get请求和Post请求的区别1.使用Get请求时,参数在URL中显示,而使用Post方式,则不会显示出来2.使用Get请求发送数据量小,Post请求发送数据量大例子页面的HTML代码:<html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <style 阅读全文
posted @ 2013-04-25 09:06 Servant 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 原文地址:http://www.cnblogs.com/MeteorSeed/archive/2012/12/24/2703716.html目录一Lucene.Net概述二 分词三 索引四 搜索五 实践中的问题一Lucene.Net概述 Lucene.Net是一个C#开发的开源全文索引库,其源码包括“核心”与“外围”两部分。外围部分实现辅助功能,而核心部分包括:Lucene.Net.Index 提供索引管理,词组排序。Lucene.Net.Search 提供查询相关功能。Lucene.Net.Store 支持数据存储管理,主要包括I/O操作。Lucene.Net.Util 公共类。Lucen. 阅读全文
posted @ 2013-04-19 15:20 Servant 阅读(307) 评论(0) 推荐(0) 编辑
摘要: 1. 基本应用 using System;using System.Collections.Generic;using System.Text;using Lucene.Net;using Lucene.Net.Analysis;using Lucene.Net.Analysis.Standard;using Lucene.Net.Documents;using Lucene.Net.Index;using Lucene.Net.QueryParsers;using Lucene.Net.Search;using Lucene.Net.Store;using Lucene.Net.Util; 阅读全文
posted @ 2013-04-19 10:25 Servant 阅读(193) 评论(1) 推荐(1) 编辑
摘要: 写全文检索模块涉及到权重的时候,不论怎么设置权重,查看检索出来的权重都是1,以为自己写错了,但是文档的得分却发生了变化。在解决所有问题以后发现了这片文章...转载过来方便大家遇到相同问题的时候不要过度的困扰...今天写了个单元测试,看看权重的变化,结果发现索引的时候啥都好好的,索引完拿出来看都是1,困惑了好一会,还好lucene的文档给出了解释:getBoostpublic float getBoost()Returns, at indexing time, the boost factor as set bysetBoost(float).Note that once a document 阅读全文
posted @ 2013-04-18 16:33 Servant 阅读(415) 评论(0) 推荐(0) 编辑
摘要: 1 public void ProcessRequest (HttpContext context) { 2 3 string elxStr = "<table><tbody><tr><td>1</td><td>11</td></tr><tr><td>2</td><td>22</td></tr></tbody></table>"; 4 context.Response.Clear(); 阅读全文
posted @ 2013-04-18 10:29 Servant 阅读(1068) 评论(0) 推荐(0) 编辑
摘要: 本文转自:http://www.cnblogs.com/peida/archive/2008/11/27/1341920.html在Lucene.net实现自定义排序,需要实现两个Lucene.Net.Search的两个接口: 1 public interface SortComparatorSource 2 { 3 ScoreDocComparator NewComparator(IndexReader reader , System.String fieldname) ; 4 } 5 6 public interface ScoreDocComparator 7 { 8 in... 阅读全文
posted @ 2013-04-17 15:51 Servant 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 公司项目使用ExtJs4 MVC搭建的页面 由于系统庞大导致首次加载页面时间过长,公司要求优化,经过一段时间的研究实现ExtJs4 MVC根据要求动态加载所需组件的js文件,也就是动态加载相应的Controller文件,其他文件会自动引用。以下列出实现的Demo关键代码和效果。(不对MVC整体框架进行详细介绍)建立测试Demo目录程序入口: 1 Ext.Loader.setConfig({ 2 enabled: true 3 }); 4 5 var application = new Ext.app.Application({ 6 name: 'GxhDemo', 7 ... 阅读全文
posted @ 2013-04-01 17:43 Servant 阅读(4641) 评论(4) 推荐(0) 编辑
摘要: 在面向对象编程中,类(class)是对象(object)的模板,定义了同一组对象(又称"实例")共有的属性和方法。Javascript语言不支持"类",但是可以用一些变通的方法,模拟出"类"。一、构造函数法这是经典方法,也是教科书必教的方法。它用构造函数模拟"类",在其内部用this关键字指代实例对象。 function Cat() { this.name = "大毛"; }生成实例的时候,使用new关键字。 var cat1 = new Cat(); alert(cat1.name); // 阅读全文
posted @ 2013-02-22 11:43 Servant 阅读(161) 评论(0) 推荐(0) 编辑