上一页 1 ··· 4 5 6 7 8 9 10 11 下一页

2014年2月18日

hash tabel 与 dictionary 的区别

摘要: 1 :Hashtable 支持多个线程读,同时只有一个线程写 , dictionary 不支持 Hashtable supports multiple reader threads with a single writer thread, while Dictionary offers no thread safety. If you need thread safety with a generic dictionary, you must implement your own synchronization or (in .NET 4.0) use ConcurrentDictionary 阅读全文

posted @ 2014-02-18 10:31 齐文宣 阅读(355) 评论(1) 推荐(0)

opengGL + glut 实现画几个简单的图元

摘要: 功能: when press "c" ------ circle "s" ------ cube with color "t" ------ triaggle "m" ----- cube with texture when press "r" ----- above primitive will rotate around y axis代码 :#include #include #include "FreeImage.h"#include #include #include 阅读全文

posted @ 2014-02-18 09:33 齐文宣 阅读(654) 评论(0) 推荐(0)

2014年2月11日

dictionary 排序方法

摘要: 假设有这样的乱序dictionary Dictionary d_Last10Mins_RQIM = new Dictionary(); d_Last10Mins_RQIM.Add("1", 10.0); d_Last10Mins_RQIM.Add("2", 20.0); d_Last10Mins_RQIM.Add("3", 30.0); d_Last10Mins_RQIM.Add("4", 90.0); d_Last10Mins_RQIM.Add("5", 11.... 阅读全文

posted @ 2014-02-11 15:37 齐文宣 阅读(7370) 评论(0) 推荐(0)

2014年1月28日

c#程序实现定时唤醒

摘要: 要实现的功能是 :每隔10分钟启动程序, 启动后做一些消耗时间的操作,但不管这些操作需要多少时间(一般不会超过10分钟) ,程序仍然准时在10分钟后启动 。while (true){ int startTime = Environment.TickCount File.AppendAllText(strCurrentPath + @"\TimerLog.txt", "begin " + DateTime.Now.ToString() + "\r\n"); //do some work which will spent time spe 阅读全文

posted @ 2014-01-28 14:48 齐文宣 阅读(845) 评论(0) 推荐(0)

2014年1月27日

在 sql server 查询子句中 , 把 in 的目标参数化

摘要: 例如以下的sql语句select * from Tags where Name in('ruby','rails','scruffy','rubyonrails')写成这样, 编译不通过declare @nameList nvarchar(100)select @nameList = 'aaa,bbb,ccc,ddd'select * from Tags where Name in @nameList如果还是想简单的传入一个字符串代表 in 的目标 , 可以:一 : 先建一个函数 , split传入的参数 , 存到 阅读全文

posted @ 2014-01-27 16:39 齐文宣 阅读(1738) 评论(0) 推荐(0)

2014年1月9日

c# 编程实现发email , 用gmail邮箱

摘要: 1 :加这两个 usingusing System.Net.Mail;using System.Net;2 : 发送人 和 收件人的设置 SmtpClient client = new SmtpClient("smtp.gmail.com", 587) { Credentials = new NetworkCredential("myEmailAddress@gmail.com", "myPassword"), EnableSsl = true }; ... 阅读全文

posted @ 2014-01-09 16:14 齐文宣 阅读(1127) 评论(0) 推荐(0)

2013年11月6日

用 Table Valued Parameter 往 sql server 插数据

摘要: 在维护以前的程序时,遇到这样的情况,需要向远程数据库写非常多的记录。原先的实现是这样的 :一 : 用datagridview显示要写入的记录,假设有10000条二:循环每一条记录,调用存储过程,将该条记录写入 ,代码如下 for (int i = 0; i @EnrollDate设 传进来的记录为 row意思是找出当前表中所有rateplanid 和row的@RatePlanID相同 ,且ExpiryDate大于row的@EnrollDate的记录然后update 这些记录的 expiryDate 然后再insert row-----------------------... 阅读全文

posted @ 2013-11-06 12:51 齐文宣 阅读(757) 评论(0) 推荐(0)

2013年10月26日

c#的windows service 怎么取当前exe的路径

摘要: windows service 不能用 directory.getcurrentdirectiry()取当前路径,正确的方法是 var location = System.Reflection.Assembly.GetEntryAssembly().Location; var directoryPath = Path.GetDirectoryName(location); 阅读全文

posted @ 2013-10-26 23:59 齐文宣 阅读(454) 评论(0) 推荐(0)

c#的windows service 为什么需要线程,老外的解释

摘要: The first time I wrote a service, I wondered whether we could do something like Listing 4, rather than go to the trouble of adding a timer. (注:我也是这么想的)Listing 4 The unstoppable service.protected override void OnStart(string[] args){ while (true) { // do some work // idle Thread.S... 阅读全文

posted @ 2013-10-26 21:58 齐文宣 阅读(720) 评论(0) 推荐(0)

2013年10月25日

asp.net 笔记

摘要: 1 : 网页重定向Response.Redirect("confirmEstockReload.aspx");2 :按钮重定向 Button1.PostBackUrl = "eStockReload.aspx"; Button2.PostBackUrl = @"..\default.aspx";3 : 设置,读取 session Session["estockResultMsg"] = sMsg; Label1.Text = Session["estockResultMsg"].ToString 阅读全文

posted @ 2013-10-25 17:22 齐文宣 阅读(110) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 10 11 下一页

导航