Saturday

display DDR type memory (RAM) installed free utility

to find out which type of memory installed you can use this free utility:
1.download CPUZ from >here
2.Run and open memory tab :

listen podcast audio book faster (timesaving tip) with mplayer

First download mplayer player from http://www.mplayerhq.hu/design7/dload.html


mplayer.exe -cache 1024 -speed 1.77 %1\*.*


Other Mplayer command line samples

play shuffle-music from directory


mplayer.exe -cache 1024 -shuffle %1\*.*


Play shuffle winamp/text file list


mplayer.exe -cache 1024 -shuffle -playlist %1

more...

Tuesday

DateTime to string with milliseconds


string resTime = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss:ffff");
Console.WriteLine(resTime);

more...

Wednesday

C# linq transfer data between linq object and business layer object sample

public class myClass
{
public int RecordID { get; set; }
public string Field1 { get; set; }
}

public void GetDataAndCallBusinessMethod()
{
using (DBDataContext db = new DBDataContext)
{
IEnumerable<myClass> Recs =
from tab in db.table
select new myClass
{
RecordID = tab.RecordID,
Field1 = tab.Field1
};
BusinessLayer.Businessmethod(Recs);
}
}

Monday

c# initialize new hashtable

Hashtable ht = new Hashtable() {
{"key1", "value1"},
{"key2", "value2"}
};

test smtp server with powershell

Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...