Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1087317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:55:21+00:00 2026-05-16T22:55:21+00:00

HttpWebRequest web; try { web = (HttpWebRequest)HttpWebRequest.Create(website.name); WebResponse Response = web.GetResponse(); Stream WebStream =

  • 0
HttpWebRequest web;
        try
        {
            web = (HttpWebRequest)HttpWebRequest.Create("website.name");

            WebResponse Response = web.GetResponse();
            Stream WebStream = Response.GetResponseStream();
            StreamReader Reader = new StreamReader(WebStream);
            string data = Reader.ReadToEnd();

            Reader.Close();
            WebStream.Close();
            Response.Close();

            string[] ver = Regex.Split(data, "version=");

            if (int.Parse(ver[1]) == int.Parse(appVersion))
            {
                tss1.Text = "Status : You currently have the latest version";               
            }
            else
            {
                tss1.Text ="Status : A new version of app is available.";
                System.Diagnostics.Process.Start("website.name");
            } 
        }
        catch (Exception ex)
        {
            tss1.Text = "Status : Update check failed.";
            Debug.Write(ex.ToString());
        }

I’m trying to use the above code to connect to webpage and pull down the latest version number for the app which it does just fine. My problem comes in when trying to compare the number found on the webpage to number provided by
appVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:55:21+00:00Added an answer on May 16, 2026 at 10:55 pm

    It seems that you want to check if the version of the running program is lower than the version string you just downloaded.

    Instead of using integer comparison you could just do Version comparison.
    Create a Version object from a string you download: var downloadedVersion = new Version(versionStringDownloadedFromWeb); and compare this to the assemblys version:

    if (Assembly.GetExecutingAssembly().GetName().Version < downloadedVersion) 
    {
      // Your version is outdated!
    }
    

    You can do this since the Version objects implements the IComparable interface.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am returning XML data from the Yahoo GeoPlanet web service using HttpWebRequest .
I'm having troubles with HttpWebRequest/HttpWebResponse and cookies/CookieContainer/CookieCollection. The thing is, if the web server
After working with .NET's HttpWebRequest / Response objects, I'd rather shoot myself than use
Here is a snippet of the code : HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(request.RawUrl); WebRequest.DefaultWebProxy =
After I get response from httpwebrequest, I'd like the cookies obtained to save for
I need to make from my app an authentificated httpwebrequest. the response to my
I wan't to connect to remote web page (that has login form) with HttpWebRequest.
How can I use HttpWebRequest (.NET, C#) asynchronously?
I'm using HttpWebRequest to pull down XML, and POST data back to a 'WebService'
Are there any known issues with canceling HttpWebRequest HTTP requests? We find that when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.