- 博客(12)
- 收藏
- 关注
原创 Get datepart
SELECT DATEADD(DAY,0, DATEDIFF(DAY,0, GETDATE()))SELECT CAST(CAST(GETDATE() AS INT) AS DATETIME)
2008-02-25 14:08:00 599
原创 segmented copy file (for network file transfer resume)
private long SectionedCopy(string srcFile, long startPos, string dstFile, bool sectioned) { byte[] buffer = new byte[1024]; int bytesRead = 0;
2008-02-25 14:07:00 722
原创 do not bind 127_0_0_1 in socket server
otherwise the server can not accept any client connection other than 127.0.0.1
2008-02-25 14:05:00 643
原创 SQL Server read text directly
1)OpenRowset, text driverSELECT *FROM OPENROWSET(MSDASQL,Driver={Microsoft Text Driver (*.txt; *.csv)};DEFAULTDIR=C:/;Extensions=CSV;, SELECT * FROM test.csv)/*content of test.csv:OrderID,Ord
2008-02-25 14:03:00 794
原创 detect if a URL is reachable
public static bool URLIsReachable(string strURL) { bool reachable = false; HttpWebRequest request = null; HttpWebResponse response = null;
2008-02-15 09:43:00 743
原创 Inline CTE number table
WITH numbers AS( SELECT 1 AS num UNION ALL SELECT num + 1 FROM numbers WHERE num ) SELECT * FROM numbers
2008-02-15 09:42:00 592
原创 NLog CSV Rolling
using NLog;using NLog.Targets;using NLog.Layouts;FileTarget target = new FileTarget(); target.FileName = "${basedir}/log.csv"; // where to store the archive files target.ArchiveFileName = "${basedir}/
2008-02-15 09:39:00 1142
原创 Excel set dateformat
Format Cell -> Number -> Customizetype your format in yyyy, MM, dd
2008-02-15 09:37:00 710
原创 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 following program:public static void Mai
2008-02-07 19:48:00 671
原创 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] static void Main(string[] args) {
2008-02-07 19:42:00 813
原创 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 void Main(string[] args)
2008-02-07 19:40:00 1044
原创 About BackgroundWorker
BackgroundWorker is a helper class in the System.ComponentModel namespace for managing a worker thread. It provides the following features: * A "cancel" flag for signaling a worker to end without u
2008-02-07 19:38:00 534
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人