Home C# Version-Checker

C# Version-Checker

C# Version-Checker


Language :
Platform :
Type :


Library :

A drop-in C# library that simplifies version checking for applications of all types.
Project Download Contributors

 

Version Checker

Build statusTravis Build Status

A drop-in C# library that simplifies version checking for applications of all types.

alt text

Version Format

The format of versions is XML. An example is structured as follows (all but the Id element are optional):

<Version>
  <Id>1.0.0.0</Id>
  <Date>26/09/15</Date>
  <Notes>
    <Note>
      <Title>1st release note</Title>
      <Content>...</Content>
    </Note>
    <Note>
      <Title>2nd release note</Title>
      <Content>...</Content>
    </Note>
  </Notes>
  <Urls>
    <Url>
      <Title>Download Link</Title>
      <Content>http://a.download.link</Content>
    </Url>
  </Urls>
</Version>

Example Use

  1. Create a folder on a website of your choice and name it appropriately (e.g. "versions")
  2. Add a file titled latestversion.xml with the format above

    var versionsLocation = "...";
    var currentVersion = new ApplicationVersion("..."); //Version identifier (e.g. 1.1.0.0)
    var versionChecker = new ApplicationVersionChecker(versionsLocation, currentVersion)
    try 
    {
    var upToDate = versionChecker.IsUpToDate();
    
    if (!versionChecker.UpToDate)
    {
        var latestVersion = versionChecker.LatestVersion;
    
        var versionId = latestVersion.Id;
        var releaseDate = latestVersion.Date;
        var releaseNotes = latestVersion.Notes;
        var urls = latestVersion.Urls;
        //...
     }
    }
    catch (Exception)
    {
    //Could not get or parse the version xml file
    }

 

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    13 + twenty =

    Leave a Comment

    20 − fifteen =