- 博客(0)
- 资源 (9)
- 收藏
- 关注
C#源码 object与json数据序列化与反序列化
利用.Net FrameWork3.5提供的Json库实现C#与Json数据转换时,对于Datetime类型的数据,生成格式如下数据
/Date(10000000000-0700)/ 不直观,同时相当部分js库无法直接使用.利用正则表达式替换成"yyyy-MM-dd HH:mm:ss"格式以便于使用
使用举例:
T t = new T();
String sJson =t.ToJson();
T t1 = JosonHelper.FromJson(sJason);
2008-09-03
C# 通过socket发送EMail的源代码
C# 通过socket发送EMail的源代码,支持Esmtp协议。支持CC 及BCC ,支持附件。<br>根据网上找到的源代码修改而来。
2008-07-31
MyBatis generator
Mybatis Generator 根据数据库自动生成相关对象及接口,默认不支持分页功能,通过plugin得以实现,使用方式,在generatorconfig.xml里引用即可:
<classPathEntry location="D:\\adintel\\projects\\hgghome\\trunk\\WebContent\\WEB-INF\\lib\mysql-connector-java-5.1.22-bin.jar" />
<context id="MysqlContext" targetRuntime="MyBatis3" defaultModelType="flat">
<property name="beginningDelimiter" value="`"/>
<property name="endingDelimiter" value="`"/>
<!-- 这里引入扩展插件 -->
<plugin type="com.addintel.pub.plugin.PaginationPlugin" />
...........
使用
UsersMapper mapper = ctx.getBean(UsersMapper.class);
PageBean pager = new PageBean(Constants.PAGE_PC);
pager.setCurrentPage(1);
UsersExample example = new UsersExample();
UsersExample.Criteria criteria = example.createCriteria();
//criteria.andSnameEqualTo("");
int totalCount = mapper.countByExample(example);
pager.setTotalCount(totalCount);
example.setLimitStart(pager.getRownumBegin());
example.setPageSize(pager.getPageSize());
List<Users> users = mapper.selectByExample(example);
...........
2016-07-08
ImageMagick
Im4java配合使用处理图片时,windows环境下新版的ImageMagick表现出各种问题,换老版的就OK,具体原因不明。问题涉及的异常:
org.im4java.core.CommandException: org.im4java.core.CommandException: convert.exe: unable to load module 'C:\ImageMagick-7.0.2-Q8\modules\coders\IM_MOD_RL_JPEG_.dll
2016-07-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人