[.NET]Send email with smtp

Code here:         static void SendMail3() {             MailMessage message = new MailMessage("from@microsoft.com", "to@microsoft.com", "subject", "test body");             message.To.Add("new@microsoft.com");  ... [More]

[VM]Increase VirtualBox hard drive size

I installed Windows 8 RC in VirtualBox with 25G virtual disk size, which squeezed with Office 2013 and Visual Studio 2012. Then, only 2G disk space is available. Now, I have two options, 1. Reinstall the Win8 2. Inscrease VHD size. Thanks for this blog entry, I found the solution.http://ttcshelbyvi... [More]

[Web]My Javascript function snippets

1. Get host URL function getHostUrl() {     var protocol = window.location.protocol;     var host = window.location.host;     return protocol + "//" + host; } 2.Timer fu... [More]

[DotNet]Sql Server connection string format

I found myself always forget the connection string format. this is a memo for it. 1. User Id and password style Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword; Initial Catalog can also be replaced by database 2. User Id and password with Trusted_Con... [More]

[Windows Phone]Live SDK Development links

1. Live Connect Developer Center http://msdn.microsoft.com/en-us/live/ 2.SignIn Scopes and permissions(wl.xxx) http://msdn.microsoft.com/en-us/library/live/hh243646 3.Sigining Users in(c#) http://msdn.microsoft.com/en-us/library/live/hh826543#csharp 4.Get Live Client Id http://manage.dev.live... [More]

[.NET]Word Frequency Calculation

As the title indicates, the following code can calcuate words appearance frequence in a text file. to use this code, 1. run it and input a file name, 2. Press Enter, few seconds later, a result file will be created which contains the word frequence information. class Program {   ... [More]

[Windows Phone]Application Bar

1. Xaml Code inside root Grid element  <phone:PhoneApplicationPage.ApplicationBar>      <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True"                  &nb... [More]

[WPF][Update]Use Dispatcher

1. When do we use Dispatcher? For example, if we create a new thread that will deal some time cost stuff. After the thread finish its work, we want to update the WPF UI. Then, it is time to use Dispatcher.      Dispatcher.Invoke(new Action(MethodName), null); If ... [More]

[.NET]Read RSS by C#

I searched around the net for a C# rss reader, but samples are either too complicated or errors prone. DataSet.ReadXml() gets a bug...So, finnaly I realized that write one of my own rss reader would be a quick and better than use one from the internet. And I think this one is the BEST:)No more words... [More]

[WIndows Phone7]List pictures in ListBox

1. Add reference to Microsoft.Xna.Framework dll . 2. Replace Grid xaml code with the following code:  <Grid x:Name="LayoutRoot">     <!--ContentPanel - place additional content here-->     <Grid x:Name="ContentP... [More]