March 2004
Intermediate to advanced
560 pages
26h 47m
English
using System;
using System.Reflection;
namespace Samples
{
public class VersionSample
{
public static void Main()
{
Type t = Typeof(String);
Assembly a = Assembly.GetAssembly(t);
AssemblyName an = a.GetName();
Version v = an.Version;
Console.WriteLine("Version: {0}", v);
Console.WriteLine("Major: {0}", v.Major);
Console.WriteLine("Minor: {0}", v.Minor);
Console.WriteLine("Build: {0}", v.Build);
Console.WriteLine("Revision: {0}", v.Revision);
v = Environment.Version;
if(v.Major == 1 && v.Minor == 0)
{
Console.WriteLine ("You are running V1");
}
else if(v.Major == 1 & v.Minor == 1)
{
Console.WriteLine ("You are running V1.1");
}
else
Console.WriteLine ("You are running an unknown version");
}
}
}
Version: 1.0.3300.0 Major: ...
Read now
Unlock full access