PageRenderTime 22ms CodeModel.GetById 19ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Platters/classes/autoupdater.cs

http://skimpt.googlecode.com/
C# | 25 lines | 18 code | 6 blank | 1 comment | 0 complexity | 615bf4be9e293e22230cfa7b6c0aae8e MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Text;
 4using System.Net;
 5
 6
 7class autoupdater
 8{    
 9
10    public static int GetLatestVersion()
11    {
12        //let us screenscrape the Google Site.
13        WebClient wc = new WebClient ();
14        byte [] pageData = wc.DownloadData ("http://code.google.com/p/skimpt");
15        string pageHtml = System.Text.Encoding.ASCII.GetString(pageData);
16
17        string ver;
18        ver = pageHtml.Substring (pageHtml.IndexOf ("!!ver:"));
19        ver = ver.Substring (6);
20        ver = ver.Remove(ver.IndexOf("!!"));
21     
22        return Convert.ToInt32(ver);
23    }
24}
25