Windows 8 Developer’s Camp 2012 – Perth, Western Australia

Ok Windows 8 Developer’s Camp 2012 is coming soon to Perth Western Australia, it will be held at University of Western Australia. This event is free and it’s a full day event filled with lessons on  developing metro style applications for Windows 8. The event will be held  on the 16th June 2012 from 9:00am to 5:30pm Saturday. 

If any developer’s from Perth, is reading this blog and would like to go and meet up at the event send me a message on twitter @david_loo.

For further details of the event and registration in your local area go to the link below:

Windows 8 Developer’s Camp Registration

C#: DataTable to CSV

 

Recently I wrote a small program to allow me to connect to a SQL database and export a selected table to a CSV file. So I needed a method that can take in a DataTable and the delimiter character to use. The returned result is a string which can be save straight to a text file.

Below is the method in my program, you may copy, modify and use it in your own program.

I use a StringBuilder class to build my lines of comma separated values and then return it as a String type. Currently the code only format string values with double quotes inserted around the value and the rest is a straight output.

(more…)

C#: How to get your computer and user name.

If you want to get your computer and user name from Windows in C# try this by using the WindowsIdentity class from System.Security.Principal namespace:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Principal;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            System.Console.Out.WriteLine(WindowsIdentity.GetCurrent().Name);
        }
    }
}
Shares