博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

随笔分类 -  C#

摘要:<td style="vnd.ms-excel.numberformat:@;"><s:property value="accountCode" /></td> //1)文本:vnd.ms-excel.numberformat:@//2)日期:vnd.ms-excel.numberformat:yy 阅读全文
posted @ 2017-06-23 14:12 阅读(342) 评论(0) 推荐(0)

摘要:1 static void Main(string[] args) 2 { 3 DataTable dt = new DataTable(); 4 dt.Columns.Add("A"); 5 dt.Columns.Add("B"); 6 dt.Columns.Add("C"); 7 dt.Rows.Add("a1", "b1", "c1")... 阅读全文
posted @ 2017-03-10 09:24 阅读(333) 评论(0) 推荐(0)

摘要:1 DataTable dtTcu = GetAllTcuInfoBySdId(sdId); 2 DataTable dtToesm = GetAllToesmBySdId(sdId); 3 4 foreach (DataRow row in dtToesm.Rows) 5 { 6 int toes 阅读全文
posted @ 2017-02-17 15:18 阅读(963) 评论(0) 推荐(0)

摘要:C# dataTable 排序 阅读全文
posted @ 2016-11-14 14:45 阅读(211) 评论(0) 推荐(0)

摘要:1 static void Main(string[] args) 2 { 3 double totalAmount = 20; 4 int num = 10; 5 double minAmount = 0.01; 6 Random r = new Random(); ... 阅读全文
posted @ 2016-10-27 09:39 阅读(2309) 评论(0) 推荐(0)

摘要:需 引用命令空间System.Security.Cryptography 阅读全文
posted @ 2016-09-27 11:32 阅读(2047) 评论(0) 推荐(0)

摘要:图片流下载string filePath = HttpContext.Current.Server.MapPath("/img/wxPic/"); if (!Directory.Exists(filePath)){ Directory.CreateDirectory(filePath);}strin... 阅读全文
posted @ 2015-10-10 17:03 阅读(2198) 评论(0) 推荐(0)

摘要:DataTable Linq查询 1.查询DataRow 2.查询某个字段 3.group by Array Linq查询 阅读全文
posted @ 2015-01-29 22:16 阅读(515) 评论(0) 推荐(0)

摘要: 阅读全文
posted @ 2014-11-05 09:45 阅读(140) 评论(0) 推荐(0)

摘要:冒泡算法C#namespace数组排序{classProgram{staticvoidMain(string[]args){inttemp=0;int[]arr={23,44,66,76,98,11,3,9,7};#region该段与排序无关Console.WriteLine("排序前的数组:");... 阅读全文
posted @ 2014-10-21 14:19 阅读(372) 评论(0) 推荐(0)

摘要:1 string jsonText = "{'name':'test','phone':'18888888888','image':[{'name':'img1','data':'data1'},{'name':'img2','data':'data2'},{'name':'img3','data... 阅读全文
posted @ 2014-09-28 22:00 阅读(3843) 评论(0) 推荐(0)

摘要:更多的时候,我们的服务器性能损耗还是在查询数据库的时候,所以对数据库的缓存还是显得特别重要,上面几种方式都可以实现部分数据缓存功能。但问题是我们的数据有时候是在变化的,这样用户可能在缓存期间查询的数据就是老的数据,从而导致数据的不一致。那有没有办法做到,数据如果不变化,用户就一直从缓存中取数据,一旦数据变化,系统能自动更新缓存中的数据,从而让用户得到更好的用户体验。 答案是肯定的!.NET已经为我们提供了这样一种非常好的解决方法:SqlCacheDependency数据库缓存依赖。 实现步骤: 下面就让我们看一下如何实现数据库缓存依赖功能: 第一步: 修改web.config,让项目启... 阅读全文
posted @ 2014-02-25 11:35 阅读(414) 评论(0) 推荐(0)

摘要:1 data: [ 2 { text: '节点1', icon: myaccount, children: [ 3 { text: '节点1.1', icon: archives }, 4 { text: '节点1.2', icon: archives }, 5 { text: '节点1.3', icon: myaccount, children: [ 6 { text: '节点1.3.1',... 阅读全文
posted @ 2014-02-14 09:59 阅读(874) 评论(0) 推荐(0)

摘要:1.隐式事务(TransactionScope)超出事务范围时 如果没有手动调用Complete()方法,则不会提交事务string strConn = "server=.;uid=sa;pwd=123;database=db_test;"; string strSql = "insert into user_info (name,tel) values ('ee',13590305258)";using (TransactionScope tran = new TransactionScope()) { using (... 阅读全文
posted @ 2012-12-29 15:02 阅读(1282) 评论(0) 推荐(0)

摘要:原理: || 运算时 当满足第一个条件时 就不再执行第二个条件了...static bool GetResult(int n, ref int sum) { sum += n; return (n - 1 <= 0) || GetResult(n - 1, ref sum); } 阅读全文
posted @ 2012-12-25 14:01 阅读(504) 评论(0) 推荐(0)

摘要:冒泡排序 1 int temp; 2 int[] arrSort = new int[] { 10, 8, 3, 5, 6, 7, 9 }; 3 for (int i = 0; i < arrSort.Length; i++) 4 { 5 for (int j = i + 1; j < arrSort.Length; j++) 6 { 7 if (arrSort[j] < arrSort[i]) 8 ... 阅读全文
posted @ 2012-12-21 11:43 阅读(30037) 评论(1) 推荐(2)