The solution posted by OriginalGriff is good, except that the last line should use the TotalMilliseconds property, instead of Milliseconds:
DateTime baseDate = new DateTime(1970, 1, 1);
TimeSpan diff = DateTime.Now - baseDate;
Console.WriteLine(diff.TotalMilliseconds);
The Milliseconds property just gives the milliseconds
component of the TimeSpan (the amount left-over after totaling the number of years, days, hours, minutes and seconds), while TotalMilliseconds gives the total number of milliseconds represented by the value.