- 博客(70)
- 资源 (32)
- 收藏
- 关注
转载 lucene、lucene.NET详细使用与优化详解
 lucene、lucene.NET详细使用与优化详解 1 lucene简介1.1 什么是luceneLucene是一个全文搜索框架,而不是应用产品。因此它并不像www.baidu.com 或者google Desktop那么拿来就能用,它只是提供了一种工具让你能实现这些产品。1.2 lucene能做什么要 回...
2018-11-22 19:42:58
427
1
转载 javascript定义类的三种方法
在面向对象编程中,类(class)是对象(object)的模板,定义了同一组对象(又称"实例")共有的属性和方法。Javascript语言不支持"类",但是可以用一些变通的方法,模拟出"类"。一、构造函数法这是经典方法,也是教科书必教的方法。它用构造函数模拟"类",在其内部用this关键字指代实例对象。 function Cat() { this
2016-08-18 18:27:20
560
原创 .net 消息队列MSMQ
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Messaging;using System.Configuration; namespace Test{ /// /// 消息队列管理器
2016-07-06 17:25:14
845
原创 Mysql Oracle Sql server 三种类型的存储过程
Oracle存储过程1.通用查询CREATE OR REPLACE PACKAGE CommonSelPack ASTYPE T_CURSOR IS REF CURSOR;PROCEDURE CommonSelect( G_typeId number, G_sum number, G_column varchar2,
2016-07-05 16:50:47
836
转载 .net mvc controler有哪些返回值
public class MyController : Controller { // 必须返回ActionResult类型 public ActionResult HelloWorld() { ViewData["Message"] = "Hello World!"; return View();
2016-07-05 16:46:21
1389
原创 .net 单件模式(基类)
using System; public class SingletonBase where T: class, new() { private static T _instance; private static object _syncObj; static Singleton
2016-07-05 16:36:28
685
原创 在webapi中使用request.Form
HttpContextBase context = (HttpContextBase)Request.Properties["MS_HttpContext"];//获取传统context HttpRequestBase request = context.Request;//定义传统request对象 string a = request.Form["a"];
2016-07-05 16:30:10
3206
原创 .net 反射,通过自定义Attribute动态调用类方法
自定义Attribute: public class ActiveAttribute : Attribute { public string Msg { get; set; } public ActiveAttribute(string msg) { Msg = msg;
2016-07-05 16:28:48
2169
1
原创 .net 反射实现两个相同结构实体类的转换
两个结构相同的实体类的转换,T2实体类的属性数可以大于T1的属性数,可用于api接口实体类参数到数据库实体的转换。public static List CopyToList(List source) { List t2List = new List(); T2 model = default(T2);
2016-07-05 16:24:20
4503
原创 当用到反射的程序部署时出现System.Data - System.Reflection.ReflectionTypeLoadException: Unable to load one or more
出现这个错误是因为某些dll无法用LoadFrom加载造成的,一般情况下是环境中缺少这个dll。另外一种情况,当你是遍历bin来反射dll时,如果不影响业务,可以把那些加载不上的dll忽略掉(前提是忽略掉的dll不影响业务)。下面的try catch的位置,一旦有一个dll加载不上,就直接抛出异常,程序不再往下进行public static string p
2016-07-05 16:20:48
5667
原创 .net 生成二维码水印
public enum ImagePosition { /**/ /// /// 左上 /// LeftTop, /**/ /// /// 左下
2016-07-05 16:17:11
1002
原创 webapi上传图片的两种方式
/// /// App上传图片 /// /// 返回上传图片的相对路径 [HttpPost] public AppReturn UploadImage() { AppReturn rModel = new AppReturn(); //
2016-07-05 16:10:56
14415
原创 C# 用interface和delgate实现回调-----配合索引器实现List
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Test{ public interface A { void Fun(); } public class B
2016-07-04 17:15:18
878
原创 后台下载微信js sdk上传的图片
var url = string.Format("https://api.weixin.qq.com/cgi-bin/media/get?access_token={0}&media_id={1}", token, media);
2016-06-27 13:54:23
1768
转载 微信开发中网页授权access_token与基础支持的access_token异同
本文转自:http://www.cnblogs.com/wellsoho/p/5089409.html问题1:网页授权access_token与分享的jssdk中的access_token一样吗?答:不一样。网页授权access_token 是一次性的,而基础支持的access_token的是有时间限制的:7200s。 问题2:网页授权access_token与基础
2016-06-23 17:31:55
5628
原创 android 图片轮播com.daimajia.slider.library.SliderLayout注意事项
1.在build文件中进行配置 compile 'com.squareup.picasso:picasso:2.3.2' compile 'com.nineoldandroids:library:2.4.0' compile 'com.daimajia.slider:library:1.1.5@aar' 2.权限 uses-permission a
2016-06-14 11:48:58
7622
1
原创 android studio Session 'app': Error Installing APK解决方案
1.重新编译2.手机拔掉,重新插3.改变android studio的设置,如下图
2016-06-03 14:59:14
37880
2
转载 android,activity跳转Html
Android混合开发之Activity类与html页面之间的相互跳转(并解决黑屏问题)在底部有本程序源码下载本程序流程:程序启动-->testActivity--->phonegap2框架类--->index.html--->testActivity,主要实现activity与html页面的相互跳转,并实现 传递参数的功能。程序结构图:
2016-04-25 11:01:15
1571
转载 android 页面切换
通用的页面跳转方法有两种:1、IntentIntent适合Activity与Activity之间的跳转,按返回键可以直接返回前一页面缺点:需要到Manifest注册Activity2、setContentView相当于选项卡,适合同一Activity里的不同View之间跳转优点:按返回键不会返回到前一页面,需要自己添加按键监听代码来实现
2016-04-25 10:45:49
601
原创 事务——锁定一行
begin tran -- 使查询的更新锁保留到事务结束select * from Project with(holdlock, updlock) where ProjectID = 79waitfor delay'00:00:30'select * from Project where ProjectID = 87commit tran
2016-03-08 12:52:11
421
原创 vs CLR20r3错误
问题事件名称: CLR20r3 问题签名 01: devenv.exe 问题签名 02: 11.0.51106.1 问题签名 03: 5098c6d7 问题签名 04: Microsoft.VisualStudio.ExtensibilityHosting 问题签名 05: 11.0.50727.1 问题签名 06: 5011ed24 问题签名 07: 4
2015-11-23 16:22:50
8887
原创 百度地图api,定位,添加城市控件,单击获得经纬度并mark
body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}单击获取点击的经纬度 // 百度地图API功能 var map = new BMap.Map("allmap"); var mk; map.c
2015-11-20 15:32:59
10888
转载 Linq 左连接 右连接 内连接
1、左连接:var LeftJoin = from emp in ListOfEmployeesjoin dept in ListOfDepartmenton emp.DeptID equals dept.ID into JoinedEmpDeptfrom dept in JoinedEmpDept.DefaultIfEmpty()select new
2015-11-03 16:34:22
3405
1
转载 什么是众筹
【一个简单的例子说众筹】一、什么是众筹?小明想开个包子铺,没钱没资源,周围也没人支持他,于是就在网上介绍自己的计划,提出自己的所需资金的数额,并承诺回报,规定时间内达到目标就启动,否则退钱给投资人,这就是“众筹”。二、什么是领头人?网上的人看到小明的计划都疯了,但是小明没空一个个回复所有人,这时,一个有钱有空有经验的带头大哥出现了,他负责协调投资人和小明之间的关系。这就是“
2015-11-03 09:48:38
840
原创 .net 枚举(使用备注)
获取备注的类: /// /// 备注特性 /// public class RemarkAttribute : Attribute { private string m_remark; public RemarkAttribute(string remark) { th
2015-07-19 18:30:36
1575
原创 .net模拟http post请求上传文件
public void SendByApi(string url, Stream postedStream, string fileName, string cType, Dictionary formDataDic) { if (string.IsNullOrEmpty(url)) throw new Ex
2015-01-26 10:59:51
7297
转载 C# out修饰符
out 关键字会导致参数通过引用来传递。这与 ref 关键字类似,不同之处在于 ref 要求变量必须在传递之前进行初始化。若要使用 out 参数,方法定义和调用方法都必须显式使用 out 关键字。例如:class OutExample{ static void Method(out int i) { i = 44; } static
2012-10-08 15:29:40
831
转载 JsonHelper
using System;using System.Collections.Generic;using System.Text;using System.IO;using System.Runtime.Serialization.Json;using System.Data;using System.Data.Common;using System.Collection
2012-06-21 17:09:36
431
原创 为单元格加斜线
New Document function drawPoint(x,y,color){document.write("");}function drawLine(obj,color){ L=obj.offsetLeft;T=obj.offsetTop;W=obj.offsetWidth;H=obj.off
2012-06-15 16:39:49
629
转载 jquery 等待效果
mask.cs:.loadmask { z-index: 100; position: absolute; top:0; left:0; -moz-opacity: 0.5; opacity: .50; filter: alpha(opacity=50); background-color: #CCC;
2011-12-15 10:53:06
5610
转载 GridView 鼠标划过行变色的几种方法
为了方便大家观看效果,首先手动写一个GridView然后绑定数据。前台代码: Width="409px" CellPadding="4" ForeColor="#333333" GridLines="None">
2011-11-30 17:41:18
1274
转载 关于 "基础连接已经关闭:接收时发生意外错误"
HttpChannel 类 HttpChannel 类使用 SOAP 协议将消息传输到远程对象或者从远程对象传输消息。所有消息都通过 SoapFormatter 对象来传递,消息在这里被更改为 XML 并被序列化,所需的 SOAP 标头将添加到流中。也可以指定二进制格式化程序,这会产生二进制数据流。然后,数据流会使用 HTTP 协议传输到目标统一资源标识符 (URI)。HttpChan
2011-11-27 17:33:11
6401
转载 WCF调用TCP 10048错误
网站,调用编写了缓冲功能的WCF,看上去一切正常。结果没多久忽然发现网站几乎不能访问了,偶尔会可以用一下,然后又抽风了……把网站的错误日志拉下来一看,统统都是这个错: TCP 错误代码 10048: 通常每个套接字地址(协议/网络地址/端口)只允许使用一次。 查了很多资料,也想了很多办法,甚至用截包软件分析了TCP数据流,最后发现,好白痴啊:当没有设置过TCP参数的
2011-11-23 13:47:03
1836
转载 当爱画上无休止的省略号,谁该给谁彼此自由,谁又该怪谁没有将彼此挽留
引导语:我们想要爱情,因为害怕寂寞。我们抗拒爱情,因为害怕受伤,然后,我们在寂寞和伤痕中,来来回回。我跟你冷颜以对,不是因为不爱你,只是,其实我比你更害怕受伤。 1.那个说永远不会离开我的人,早已离开了,那个说爱我的人,牵着的却是别人的手,那个说会等我的人,却跟另一个人走了。还有什么可以相信呢? 2.心总是在最痛时,复苏;爱总是在最深时,落下帷幕。总是情不自禁的忧
2011-10-31 13:48:57
549
转载 FileDownLoad
public class FileDownLoad { /// /// 通用下载函数 /// /// 文件名 /// 文件路径 public static bool DownLoadFile(string fileName, string filePath)
2011-10-26 17:49:34
662
转载 FileHelper
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.Web;using System.Web.UI.WebControls;namespace CommonFunctions{ publi
2011-10-26 17:47:19
1011
原创 json数据转换
public class JsonOperation { /// 功能:格式化成Json字符串 /// /// 需要格式化的对象 /// Json字符串 public static string ToJson(object obj)
2011-10-26 17:43:57
638
转载 ExcelHelper
using System;using System.IO;using System.Text;using System.Data;using System.Security;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.HtmlCont
2011-10-26 17:42:27
706
转载 跨子域域验证
public class CommonFun { /// /// [获取/设置]认证类型,比如NTLM等 /// public string AuthType { get { return fAu
2011-10-26 17:39:35
572
C#代码性能分析工具RedGateReflectorProfiler7_5
2014-06-26
.net 三层+Wcf框架(自适应Oracle,Mysql,SqlServer三种数据库,完整实例)
2013-10-21
.net 三层+Wcf框架实例(自适应Oracel,Mysql和Sql Server三种数据库)
2013-10-21
几种.net调用memcached的开源类库
2015-03-26
Hmail server+Afterlogic webmail lite搭建免费邮件服务器
2014-07-08
mvc中上传头像及裁剪(AjaxFileUploader+cropzoom)
2014-07-02
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人