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

  • SEARCH
  • Home
  • 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 6139741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:01:47+00:00 2026-05-23T18:01:47+00:00

Awhile ago, I started making a program in vb.net. Since then i’ve lost the

  • 0

Awhile ago, I started making a program in vb.net. Since then i’ve lost the code, and started using c#.
I have everything converted, except the update system I had gives me “Cannot implicitly convert type ‘string’ to ‘int’ streamreader”.

Heres the old code:

        Try
        Dim Build As Integer
        Build = 3

        Dim url As String
        url = "###link###"
        Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(url)
        Dim response As System.Net.HttpWebResponse = request.GetResponse()
        Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("windows-1252"))
        Dim Online As Integer
        Online = sr.ReadToEnd()

        If Build >= Online Then
            Label10.Visible = True
        Else
            LinkLabel1.Visible = True
        End If
    Catch ex As Exception
        Me.Close()
    End Try

Here’s the code i converted:

            try
        {
            int Build = 0; 
            Build = 3;

            string url = null;
            url = "###link###";
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
            WebResponse response = request.GetResponse();
            System.IO.StreamReader sr = new System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("windows-1252"));
            int Online = 0;
            Online = sr.ReadToEnd();

            if (Build >= Online)
            {
                Label10.Visible = true;
            }
            else
            {
                LinkLabel1.Visible = true;
            }
        }
        catch (Exception ex)
        {
            this.Close();
        }

I’ve been googling for days and have found no similar errors or fixes. Any help is appreciated.

  • 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-23T18:01:48+00:00Added an answer on May 23, 2026 at 6:01 pm
    int Online;
    string onlineString = sr.ReadToEnd(); 
    Online = int.Parse (onlineString);
    

    There are three built-in ways to convert a string to an integer.

    int myInt;
    myInt = Convert.ToInt32 (s);
    myInt = int.Parse (s); // or Int32.Parse (s); // same thing.
    if (int.TryParse (s, out myInt)
        Console.WriteLine ("parse successful");
    else
        Console.WriteLine ("parse failed, but no exception was thrown");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

1) A while ago I’ve started learning Asp.Net, but then I’ve heard that Ajax
I have a domain, call it mydom.com. A while ago I started using Google
We have over 1000 unit tests. A while ago 18 of them started to
Since Heroku began Facebook integration awhile ago, I've wanted to deploy a few PHP
Hey everyone! Started programming with Bluetooth on Android awhile ago. But now I've run
It's been awhile since I've wrote applications that dealt with money. Many years ago,
I have a backup server that replicates my production server's mysql database, awhile ago
I've started using OpenGL a while ago, using GLUT. You can't pass member functions
I started using Java a while ago so this is probably a silly question
A while ago, I started on a project where I designed a html-esque XML

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.