Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

Get build minor revision and major revision of object of version class in vb - C #.net.

Author: Maliha Atteeq
Download Source Code : 1016_versionApps.zip

In this simple article you will learn that how to get build, minor, major, revision, minor revision and major revision of the object of version using Version class in vb and C #.net.

 Get build:

In order to get build of the version object, version class provides us a property named as Build. The return type of this property is integer as it returns the build number. It returns -1 if we initialize the object by using blank constructor.

To demonstrate make a new window application. Drag one button on from.

Now write the following code on Button click event:

C#:

private void btn_getBuild_Click(object sender, EventArgs e)

        {

            int build;

            build=obj.Build;

            MessageBox.Show("the build of this object is "+Convert.ToString(build));

        }

VB:

Private Sub btn_getBuild_Click(ByVal sender As Object, ByVal e As EventArgs)

        Dim build As Integer

        build = obj.Build

        MessageBox.Show("the build of this object is " & Convert.ToString(build))

    End Sub

Get minor:

In order to get minor of the version object, version class provides us a property named as Minor. The return type of this property is integer as it returns the minor number. It returns 0 if we initialize the object by using blank constructor.

To demonstrate make a new window application. Drag one button on from.

Now write the following code on Button click event:

C#:

private void btn_getMinor_Click(object sender, EventArgs e)

        {

            int minor;

            minor=obj.Minor;

            MessageBox.Show("the minor of this object is " + Convert.ToString(minor));

        }

VB:

Private Sub btn_getMinor_Click(ByVal sender As Object, ByVal e As EventArgs)

        Dim minor As Integer

        minor = obj.Minor

        MessageBox.Show("the minor of this object is " & Convert.ToString(minor))

    End Sub

Get major:

In order to get major of the version object, version class provides us a property named as Major. The return type of this property is integer as it returns the major number. It returns 0 if we initialize the object by using blank constructor.

To demonstrate make a new window application. Drag one button on from.

Now write the following code on Button click event:

C#:

private void btn_getMajor_Click(object sender, EventArgs e)

        {

            int major;

            major = obj.Major;

            MessageBox.Show("the major of this object is " + Convert.ToString(major));

 

        }

VB:

Private Sub btn_getMajor_Click(ByVal sender As Object, ByVal e As EventArgs)

        Dim major As Integer

        major = obj.Major

 

        MessageBox.Show("the major of this object is " & Convert.ToString(major))

    End Sub

Get revision:

In order to get revision of the version object, version class provides us a property named as Revision. The return type of this property is integer as it returns the revision number. It returns -1 if we initialize the object by using blank constructor.

To demonstrate make a new window application. Drag one button on from.

Now write the following code on Button click event:

C#:

  private void btn_getRevision_Click(object sender, EventArgs e)

        {

            int rev;

            rev = obj.Revision;

            MessageBox.Show("the revision of this object is " + Convert.ToString(rev));

        }

VB:

Private Sub btn_getRevision_Click(ByVal sender As Object, ByVal e As EventArgs)

        Dim rev As Integer

        rev = obj.Revision

 

        MessageBox.Show("the revision of this object is " & Convert.ToString(rev))

    End Sub

Get major revision:

In order to get major revision of the version object, version class provides us a property named as MajorRevision. The return type of this property is short as it returns the high 16 bit of the revision number. It returns -1 if we initialize the object by using blank constructor.

To demonstrate make a new window application. Drag one button on from.

Now write the following code on Button click event:

C#:

private void btn_getMajorRev_Click(object sender, EventArgs e)

        {

            short maj_rev;

            maj_rev = obj.MajorRevision;

            MessageBox.Show("the major revision of this object is " + Convert.ToString(maj_rev));

        }

VB:

Private Sub btn_getMajorRev_Click(ByVal sender As Object, ByVal e As EventArgs)

        Dim maj_rev As Short

        maj_rev = obj.MajorRevision

 

        MessageBox.Show("the major revision of this object is " & Convert.ToString(maj_rev))

    End Sub

 

Get minor revision:

In order to get minor revision of the version object, version class provides us a property named as MinorRevision. The return type of this property is short as it returns the low 16 bit of the revision number. It returns -1 if we initialize the object by using blank constructor.

To demonstrate make a new window application. Drag one button on from.

Now write the following code on Button click event:

C#:

private void btn_getMin_rev_Click(object sender, EventArgs e)

        {

            short min_rev;

            min_rev = obj.MinorRevision;

            MessageBox.Show("the minor revision of this object is " + Convert.ToString(min_rev));

        }

 

VB:

Private Sub btn_getMin_rev_Click(ByVal sender As Object, ByVal e As EventArgs)

        Dim min_rev As Short

        min_rev = obj.MinorRevision

 

        MessageBox.Show("the minor revision of this object is " & Convert.ToString(min_rev))

    End Sub

Now write the following code on FORM LOAD event:

C#:

private void Form1_Load(object sender, EventArgs e)

        {

            this.Text = "DEVASP VERSION APPLICATION";

           

        }

Vb:

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)

 

        Me.Text = "DEVASP VERSION APPLICATION"

    End Sub

This simple article tells that how to get build, minor, major, revision, minor revision and major revision of the object of version using Version class in vb and C #.net.

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< How to use Version class in vb.net - C #.net.

Disclaimer - Privacy
© 2002-2017 DevASP.net