Trending Up...

Trending Up...

C# frequently use code snippet

// popup message modeless dialog static void PopUpMsg(string msg) { TextBox editBox = new TextBox(); editBox....

2011-10-27 21:16:00

阅读数 441

评论数 0

Network Interceptor

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Net.Sockets; namespace

2011-10-11 22:49:10

阅读数 384

评论数 0

LINQ join and CSV read/write

class Customer { public int ID { get; set; } public string Name { get; set; } } class Order { publ

2011-09-30 18:35:42

阅读数 629

评论数 0

Linq in action notes (5 lang features required for LINQ)

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace LinqInAction { class ProcessData {

2011-09-29 22:34:41

阅读数 392

评论数 0

C# download yahoo stock quote

WebClient.DownloadFile

2010-12-15 13:53:00

阅读数 657

评论数 0

C# use TryParseExact to convert string to date

  static void Test1()        {            List list1 = new List();            list1.Add("2009/08/03");            list1.Add("2009/8/4&...

2009-11-01 13:41:00

阅读数 690

评论数 0

Auto save UI Setting in C#

using System;using System.Collections.Generic;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;using System.IO;names...

2008-10-15 17:47:00

阅读数 524

评论数 0

C# modify file (read all and modify and write all)

 StringBuilder newFile = new StringBuilder();string temp = "";string[] file = File.ReadAllLines(@"C:/Documents and Settings/john.grove...

2008-07-16 11:55:00

阅读数 759

评论数 0

C# 2.0 send email

         private void SendMail(string smtpHost, string sender,            string[] receivers, string subject, string content)        {            try...

2008-07-16 11:54:00

阅读数 553

评论数 0

hide insteadof close form

         private void frmMain_Closing(object sender, System.ComponentModel.CancelEventArgs e)        {            this.Hide();            e.Cancel = ...

2008-07-16 11:53:00

阅读数 651

评论数 0

C# join DataTable (support Left/Right/Full join)

 using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Wind...

2008-07-16 11:52:00

阅读数 7184

评论数 3

Counting number of line in a file

private long CountLine(string fileName){    using(StreamReader sr = new StreamReader(                new FileStream(fileName,FileMode.Open,          ...

2008-04-01 09:10:00

阅读数 584

评论数 0

C# let textbox only accept numeric input

private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e){    e.Handled = !        (char.IsDigit(e.KeyChar) || e.KeyCha...

2008-04-01 09:10:00

阅读数 1037

评论数 1

Return multiple dataset

             // (1)            OleDbDataAdapter da = new OleDbDataAdapter(                "select * from jobs;select * from employee", //in...

2008-03-15 11:40:00

阅读数 481

评论数 0

CSharp restart program

start a new instance of the program and close the old one Process.Start(Application.ExecutablePath,Process.GetCurrentProcess().Id.ToString());this.Cl...

2008-03-11 09:22:00

阅读数 459

评论数 0

NLog CSV Rolling

using NLog;using NLog.Targets;using NLog.Layouts;FileTarget target = new FileTarget(); target.FileName = "${basedir}/log.csv"; // where to ...

2008-02-15 09:39:00

阅读数 728

评论数 0

Thread Exception Handling (Excerpt from WWW)

Exception HandlingAny try/catch/finally blocks in scope when a thread is created are of no relevance once the thread starts executing. Consider the f...

2008-02-07 19:48:00

阅读数 510

评论数 0

Get cruuent function name, file... (even in release build)

using System;using System.Data;using System.IO;using System.Diagnostics;namespace ConsoleApplication1{    class Class1    {        [STAThread]       ...

2008-02-07 19:42:00

阅读数 684

评论数 0

C# read xml from a string and performance test

using System;using System.Data;using System.IO;using System.Xml;namespace ConsoleApplication1{    class Class1    {        [STAThread]        static ...

2008-02-07 19:40:00

阅读数 874

评论数 0

Recursive delegate and state pattern (C# version)

The concept is originated from "Practise StateCharts in C++", where author use member function pointer to represent state pattern.c# versio...

2007-11-20 09:59:00

阅读数 523

评论数 0

提示
确定要删除当前文章?
取消 删除
关闭
关闭