System.DateTime

var dateTimeOutput = document.getElementById('DateTimeOutput');
var dateTime = new System.DateTime(2006, 4, 17, 14, 22, 48);
 
dateTimeOutput.innerHTML += System.String.Format('(d) Short date: {0} <br />', dateTime.ToString('d'));
dateTimeOutput.innerHTML += System.String.Format('(D) Long date: {0} <br />', dateTime.ToString('D'));
dateTimeOutput.innerHTML += System.String.Format('(t) Short time: {0} <br />', dateTime.ToString('t')); 
dateTimeOutput.innerHTML += System.String.Format('(T) Long time: {0} <br />', dateTime.ToString('T')); 
dateTimeOutput.innerHTML += System.String.Format('(f) Full date/short time: {0} <br />', dateTime.ToString('f')); 
dateTimeOutput.innerHTML += System.String.Format('(F) Full date/long time: {0} <br />', dateTime.ToString('F')); 
dateTimeOutput.innerHTML += System.String.Format('(g) General date/short time: {0} <br />', dateTime.ToString('g')); 
dateTimeOutput.innerHTML += System.String.Format('(G) General date/long time (default): {0} <br />', dateTime.ToString('G')); 
dateTimeOutput.innerHTML += System.String.Format('(M) Month: {0} <br />', dateTime.ToString('M')); 
dateTimeOutput.innerHTML += System.String.Format('(s) Sortable: {0} <br />', dateTime.ToString('s'));
dateTimeOutput.innerHTML += System.String.Format('(Y) Year: {0} <br />', dateTime.ToString('Y'));    
        

Results

System.Guid

var guid = System.Guid.NewGuid();
var guid2 = System.Guid.Empty;
var guidOutput = document.getElementById('GuidOutput');
            
guidOutput.innerHTML = System.String.Format('guid.ToString() = {0}<br />', guid.ToString());
guidOutput.innerHTML += System.String.Format('guid2.ToString() = {0}<br />', guid2.ToString());
guidOutput.innerHTML += System.String.Format('guid.CompareTo(guid2) = {0}<br />', guid.CompareTo(guid2));
guidOutput.innerHTML += System.String.Format('guid.Equals(guid2) = {0}<br />', guid.Equals(guid2));
        

Results

System.Drawing.Point

var pointOutput = document.getElementById('PointOutput');
var point = new System.Drawing.Point(0, 0);
            
pointOutput.innerHTML = System.String.Format('point = ({0}, {1})<br />', point.X, point.Y);
            
point.Offset(20, 100);
pointOutput.innerHTML += System.String.Format('offset point = ({0}, {1})', point.X, point.Y);
        

Results

System.Drawing.Rectangle

var rectangleOutput = document.getElementById('RectangleOutput');
var rectangle = System.Drawing.Rectangle.FromLTRB(0, 0, 100, 100);

rectangleOutput.innerHTML = System.String.Format('rectangle.IsEmpty() = {0}<br />', rectangle.IsEmpty());
rectangleOutput.innerHTML += System.String.Format('rectangle.Location = {0}<br />', rectangle.Location);
rectangleOutput.innerHTML += System.String.Format('rectangle.Size = {0}<br /><br />', rectangle.Size);
            
rectangle.Inflate(new System.Drawing.Size(50, 50))
rectangle.Offset(new System.Drawing.Point(100, 100));

rectangleOutput.innerHTML += System.String.Format('rectangle.Location = {0}<br />', rectangle.Location);
rectangleOutput.innerHTML += System.String.Format('rectangle.Size = {0}<br /><br />', rectangle.Size);
        

Results

System.Drawing.Size

var sizeOutput = document.getElementById('SizeOutput');
var size = new System.Drawing.Size(0,0);
            
sizeOutput.innerHTML = System.String.Format('size.IsEmpty() = {0}<br />', size.IsEmpty());
sizeOutput.innerHTML += System.String.Format('size.Height = {0}<br />', size.Height);
sizeOutput.innerHTML += System.String.Format('size.Width = {0}<br /><br />', size.Width);
            
size.Height = 200;
size.Width = 400;
sizeOutput.innerHTML += System.String.Format('size.IsEmpty() = {0}<br />', size.IsEmpty());
sizeOutput.innerHTML += System.String.Format('size.Height = {0}<br />', size.Height);
sizeOutput.innerHTML += System.String.Format('size.Width = {0}<br />', size.Width);
        

Results

System.Diagnostics.Stopwatch

var stopwatchOutput = document.getElementById('StopwatchOutput');
var stopwatch = new System.Diagnostics.Stopwatch();
stopwatch.Start();
setTimeout(stopWatchTimeout, 2000);

function stopWatchTimeout()
{
    stopwatch.Stop();

    // Get the elapsed time as a TimeSpan value.
    var ts = new System.TimeSpan(0, 0, 0, 0, stopwatch.GetEllapsedMilliseconds());

    // Format and display the TimeSpan value.
    var elapsedTime = System.String.Format("{0}:{1}:{2}.{3}", ts.GetHours(), ts.GetMinutes(), ts.GetSeconds(), ts.GetMilliseconds() / 10);
    stopwatchOutput.innerHTML = "RunTime: " + elapsedTime;
}
        

Results

System.String

document.getElementById('StringOutput').innerHTML = System.String.Format('{0} {1} {2} {3} {4} {5}{6}.', 'An', 'example', 'of', 'System.String.Empty.Format', 'and', 'System.String.Empty', System.String.Empty);    
        

Results

System.Text.StringBuilder

var stringBuilderOutput = document.getElementById('StringBuilderOutput');

// Initialize the StringBuilder with "ABC".
var sb = new System.Text.StringBuilder("ABC");

// Append three characters (D, E, and F) to the end of the StringBuilder.
sb.Append('DEF');

// Append a format string to the end of the StringBuilder.
sb.AppendFormat("GHI{0}{1}", 'J', 'k');

// Display the number of characters in the StringBuilder and its string.
stringBuilderOutput.innerHTML = System.String.Format("{0} chars: {1}", sb.GetLength(), sb.ToString());
        

Results

System.TimeSpan

var timeSpanOutput = document.getElementById('TimeSpanOutput');
var timeSpan = new System.TimeSpan(10, 20, 30, 40, 50);

timeSpanOutput.innerHTML += System.String.Format('Days: {0}<br />', timeSpan.GetDays());
timeSpanOutput.innerHTML += System.String.Format('Hours: {0}<br />', timeSpan.GetHours());
timeSpanOutput.innerHTML += System.String.Format('Minutes: {0}<br />', timeSpan.GetMinutes());
timeSpanOutput.innerHTML += System.String.Format('Seconds: {0}<br />', timeSpan.GetSeconds());
timeSpanOutput.innerHTML += System.String.Format('Milliseconds: {0}<br /><br />', timeSpan.GetMilliseconds());

timeSpanOutput.innerHTML += System.String.Format('TotalDays: {0}<br />', timeSpan.GetTotalDays());
timeSpanOutput.innerHTML += System.String.Format('TotalHours: {0}<br />', timeSpan.GetTotalHours());
timeSpanOutput.innerHTML += System.String.Format('TotalMinutes: {0}<br />', timeSpan.GetTotalMinutes());
timeSpanOutput.innerHTML += System.String.Format('TotalSeconds: {0}<br />', timeSpan.GetTotalSeconds());
timeSpanOutput.innerHTML += System.String.Format('TotalMilliseconds: {0}<br />', timeSpan.GetTotalMilliseconds());
        

Results

System.Uri

var uriOutput = document.getElementById('UriOutput');
var uri = new System.Uri('http://www.contoso.com/catalog/shownew.htm?date=today#fragment');
            
uriOutput.innerHTML = System.String.Format('uri.GetAbsolutePath() = {0}<br />', uri.GetAbsolutePath());
uriOutput.innerHTML += System.String.Format('uri.GetAuthority() = {0}<br />', uri.GetAuthority());
uriOutput.innerHTML += System.String.Format('uri.GetFragment() = {0}<br />', uri.GetFragment());
uriOutput.innerHTML += System.String.Format('uri.GetHost() = {0}<br />', uri.GetHost());
uriOutput.innerHTML += System.String.Format('uri.GetPathAndQuery() = {0}<br />', uri.GetPathAndQuery());
uriOutput.innerHTML += System.String.Format('uri.GetPort() = {0}<br />', uri.GetPort());
uriOutput.innerHTML += System.String.Format('uri.GetQuery() = {0}<br />', uri.GetQuery());
uriOutput.innerHTML += System.String.Format('uri.GetScheme() = {0}<br />', uri.GetScheme());
uriOutput.innerHTML += System.String.Format('uri.IsDefaultPort() = {0}<br />', uri.IsDefaultPort());
uriOutput.innerHTML += System.String.Format('uri.IsFile() = {0}<br />', uri.IsFile());
uriOutput.innerHTML += System.String.Format('uri.IsLoopback() = {0}<br />', uri.IsLoopback());
        

Results