2012年8月25日
摘要: 在做Web开发时,我们经常需要对过长的文章标题剪切,一般剪切方法是按字符数剪切,出现中文与英文标题会出现长短不一。为此写了一个按照字节剪切字符串的工具方法。 /// <summary> /// 按字节剪切字符串的方法 /// </summary> /// <param name="content"> 需要剪切的内容 </param> /// <param name="maxLength"> 需要显示的最大长度 </param> /// <returns> 剪切后的字符串 阅读全文
posted @ 2012-08-25 11:31 上善若水123 阅读(463) 评论(0) 推荐(0) 编辑
摘要: 之前写过一篇Unity和PIAB的文章,但是那是将Unity和PIAB的配置信息写在同一个文件中,如果在真正项目中,这样会很造成配置信息的混乱。今天就看看怎么分开配置文件。 Unity 配置文件。<?xml version="1.0"?><configuration> <configSections> <section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microso 阅读全文
posted @ 2012-08-25 10:49 上善若水123 阅读(776) 评论(0) 推荐(0) 编辑
摘要: 表关系图:需求:我想要查询的数据结果是:我们可以内连接:select s.id,s.name,srt.typeId, stt.name as TypeName from scenics as sINNER JOIN(select * from scenics_type) srt on srt.scenicsId=s.idINNER JOIN(SELECT * from scenicstype where deleted=0)stt on stt.id=srt.typeId得到结果是:显然我们需要分组,合并一下数据。select s.id,s.name,srt.typeId, stt.nam.. 阅读全文
posted @ 2012-08-25 10:27 上善若水123 阅读(4305) 评论(0) 推荐(0) 编辑