MVP? MVP!

i love C#
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  C#

C#
摘要:首先,我们分析一下异步处理的环境 需要在当前线程中获取返回值 不需要在当前线程中获取返回值,但是仍然需要对返回值做处理对于第1中情况,还可以继续细分 在当前线程中启动线程T,然后继续执行当前线程中的其它任务,最后在当前线程中获取T的返回值 在当前线程中启动线程T,然后继续执行当前线程中的其它任务R1,等待T执行完成,当T执行完成后,继续执行当前线程中的其它任务R2,最后获取T的返回值 在当前线程中... 阅读全文

posted @ 2010-01-15 12:10 renhb 阅读(394) 评论(0) 推荐(0)

摘要:草草看完了一本介绍3.5四大利器的书,不到800页,看了半个月吧。收获不小,但仅仅是概念上的,因为3.5实际上就是2.0,语法上没有任何变化。微软硬生生把几项革新的技术捆绑到3.5中,在我看来真的是没必要,2.0加四大插件的形式完全更合适。看来微软整事的功夫不比中国人差啊。首先说LINQ,在我没接触它之前,武断的有过一个结论,这东西只是又一个ORM。BY THE WAY,提到ORM我喊一声,现在流... 阅读全文

posted @ 2009-08-18 21:29 renhb 阅读(357) 评论(1) 推荐(0)

摘要://DataTable转成Json public static string DataTableToJson(string jsonName, DataTable dt) { StringBuilder Json = new StringBuilder(); Json.Append("{\"" + jsonName + "\":["); if (dt.Rows.Count > 0) { fo... 阅读全文

posted @ 2009-08-12 12:01 renhb 阅读(321) 评论(2) 推荐(0)

摘要:背景:一个用户系统里的充值功能,假设WINFORM程序,当用户输入一定的充值金额并提交后,系统需要完成两个操作:1是更新此用户的级别。2是将此次充值操作记录到数据表中以备查询。由于项目需要,更新用户信息和记录充值信息分别做成两个类库项目,各自完成更新用户表和插入充值历史表的功能,便于扩展和维护。需求:当用户提交充值的时候,要求先记录此次充值信息,然后更新用户表的GRADE字段。如在此过程中意外中止... 阅读全文

posted @ 2009-08-05 17:24 renhb 阅读(375) 评论(15) 推荐(0)

摘要:[STAThread]public static void Main(){ bool ret; System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out ret); if (ret) { System.Windows.Forms.Ap... 阅读全文

posted @ 2009-02-11 10:34 renhb 阅读(441) 评论(0) 推荐(0)

摘要:if (!EventLog.SourceExists("Misc16")) { EventLog.CreateEventSource("Misc16", "RondiMiscLog"); } EventLog myLog = new EventLog(); myLog.Source... 阅读全文

posted @ 2009-01-15 10:45 renhb 阅读(332) 评论(0) 推荐(0)

摘要:添加引用System.ServiceProcess.dll C# code ServiceController sc = new ServiceController(); sc.ServiceName = "服务名"; 以下是启动服务和停止服务的按钮事件 C# code private void btnStart_Click(object sender, EventA... 阅读全文

posted @ 2009-01-14 10:16 renhb 阅读(279) 评论(0) 推荐(0)

摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.Runtime.Serialization.Formatters.Binary; namespace GenerateCode{ /// /// 泛型 序列化+反序... 阅读全文

posted @ 2008-12-11 14:58 renhb 阅读(430) 评论(2) 推荐(0)

摘要:public string IsAuthenticated(string UserID, string Password) { string _path = "LDAP://192.168.10.71/DC=wwsp,DC=com";//"LDAP://172.75.200.1/DC=名字,DC=com,DC=cn"; string _fi... 阅读全文

posted @ 2008-11-19 10:48 renhb 阅读(425) 评论(2) 推荐(0)

摘要:private string getPostBackControlName() { Control control = null; string ctrlname = Page.Request.Params["__EVENTTARGET"]; if (ctrlname != null && ctrlname != String.Empty) ... 阅读全文

posted @ 2008-10-23 16:10 renhb 阅读(340) 评论(0) 推荐(0)

摘要:List aa = new List(new string[] { "a", "b", "c", "d" }); List bb = new List(new string[] { "a", "c" });目的:判断一个数组中的每个值是否都存在于另一个数组中.例: bool ret=bb.TrueForAll(delegate(string s) { return aa.Cont... 阅读全文

posted @ 2008-09-24 16:37 renhb 阅读(521) 评论(2) 推荐(0)

摘要:delegate\event的方法:类X:using System;using System.Collections.Generic;using System.Windows.Forms;using System.Text;namespace WindowsFormsApplication1{ public class ClassX { public delegate v... 阅读全文

posted @ 2008-09-20 12:01 renhb 阅读(170) 评论(0) 推荐(0)

摘要:System.Diagnostics.Process.Start(@"D:\晓娜\Storm.exe", @"D:\晓娜\111.mp3"); 阅读全文

posted @ 2008-09-18 10:53 renhb 阅读(570) 评论(0) 推荐(0)

摘要:Process p = new Process(); p.StartInfo.FileName = @"C:\windows\system32\command.com"; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardInput = true; ... 阅读全文

posted @ 2008-09-18 10:50 renhb 阅读(285) 评论(0) 推荐(0)

摘要:using System;using System.Drawing;using System.Web.UI;using Dundas.Charting.WebControl; namespace Web{ public partial class WebForm1 : Page { private void Page_Load(object sender, EventA... 阅读全文

posted @ 2008-09-04 15:37 renhb 阅读(356) 评论(0) 推荐(0)

摘要:foreach (SortType s in System.Enum.GetValues(typeof(SortType))) { this.sort.Items.Add(new ListItem(s.ToString(), ((int)s).ToString())); } 阅读全文

posted @ 2008-09-03 17:19 renhb 阅读(176) 评论(0) 推荐(0)

摘要:// using System.Diagnostics;private string appName = "calc.exe";/// /// 1. 启动外部程序,不等待其退出/// private void button1_Click(object sender, EventArgs e){Process.Start(appName);MessageBox.Show(String.Format(... 阅读全文

posted @ 2008-08-28 13:18 renhb 阅读(403) 评论(0) 推荐(0)

摘要:System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping(); System.Net.NetworkInformation.PingReply rep= ping.Send("127.0.0.1"); Console.WriteLine(rep.St... 阅读全文

posted @ 2008-08-25 10:24 renhb 阅读(284) 评论(1) 推荐(0)

摘要:前台: ... 阅读全文

posted @ 2008-08-24 14:09 renhb 阅读(2402) 评论(0) 推荐(0)