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 8364339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:24:31+00:00 2026-06-09T12:24:31+00:00

i have inserted some web URL’s in a text file. Like: www.google.com www.facebook.com www.twitter.com

  • 0

i have inserted some web URL’s in a text file.

Like:

www.google.com
www.facebook.com
www.twitter.com
www.yahoo.com

And I want to browse web page URL form text file in c# webBrowse1 control.

please tell me how it works.

This is my code but it didn’t work.

try
{
    FileStream fs = new FileStream("link.txt",FileMode.Open,FileAccess.Read);
    StreamReader sr = new StreamReader(fs);
    webBrowser1.Navigate(sr);
    webBrowser1.ScriptErrorsSuppressed = true;
    while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
    {
        Application.DoEvents();
    }
}
catch(Exception)
{
     MessageBox.Show("Internet Connection not found", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     this.Close();
}
  • 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-06-09T12:24:32+00:00Added an answer on June 9, 2026 at 12:24 pm

    Well, the main problem I see is you’re trying to navigate to a stream:

    StreamReader sr = new StreamReader(fs);
    webBrowser1.Navigate(sr); //<-- This doesn't make any sense!
    

    What you probably want to do is loop through the text file and read each line:

    foreach(string url in File.ReadLines("link.txt"))
    {
       webBrowser1.Navigate(url);
    
       // Do stuff here with your webBrowser1 control
    }
    

    This will loop through each line in link.txt and call Navigate() on each one. I’m not quite sure if that’s what you want, so please clarify if there’s more to this problem.

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

Sidebar

Related Questions

I have inserted this form with multiple checkbox items which collects some values, What
I am having a table in which we have some 20 million entries inserted(blind
I'm using VS2010,C# to develop my ASP.NET web app. I have some a combo
I don't have ID's to look at since some rows are inserted dynamically via
I have a php script that gets user input (some text and a link),
I have a pipe delimited file with some NULL date fields. I load this
I have an app with detail view. This detail view contains some web views(3).
In one of my MVC3 web applications I have recently noticed some strange looking
The context I have an Asp .Net web application with some pages that inherit
I'm starting with jQuery mobile and have some problems with my buttons. The web

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.