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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:01:17+00:00 2026-05-20T01:01:17+00:00

Hi all i searched for IEnumerator but could not get to understand it.it would

  • 0

Hi all i searched for IEnumerator but could not get to understand it.it would be great help if anyone helps me.

basically trying to understand the its role in this code

string requestUriString = URL;
if (requestUriString.IndexOf("http://", StringComparison.InvariantCultureIgnoreCase) < 0)
{
    requestUriString = "http://" + requestUriString;
}
WebRequest request = WebRequest.Create(requestUriString);
try
{
    IEnumerator enumerator;
    StreamReader reader = new StreamReader(request.GetResponse().GetResponseStream(), Encoding.UTF8);
    string sSourceString = reader.ReadToEnd();
    reader.Close();
    string str6 = this.funcParseStringFromString2String(sSourceString, "<div class=\"title\">", "<div class=\"searches_related\">", false);
    ArrayList list = new ArrayList();
    list = this.funcParseStringFromString2Stringx(str6, "<h3><a ", "</h3>", false);
    int num = this.DataGridView2.RowCount + 1;
    try
    {
        enumerator = list.GetEnumerator();
        while (enumerator.MoveNext())
        {
            string str8 = Conversions.ToString(enumerator.Current);
            string str7 = this.funcParseStringFromString2String(str8, "title=\"", "\" href=", false);
            string str5 = this.funcParseStringFromString2String(str8, "\" href=\"", "\">", false).Replace("\" class=\"rated", "");
            this.DataGridView2.Rows.Add(new string[] { Conversions.ToString(num), Conversions.ToString(false), str7, str5 });
            this.lblInsProg.Text = "Done: " + Conversions.ToString(this.DataGridView2.Rows.Count) + " Articles found";
            num++;
        }
    }
    finally
    {
        if (enumerator is IDisposable)
        {
            (enumerator as IDisposable).Dispose();
        }
    }
    if (list.Count == 0)
    {
        this.lblInsProg.Text = "No results found for " + this.search.Text + "!";
        this.Button11.Enabled = false;
    }
    else
    {
        this.Button11.Enabled = true;
    }
    if (this.DataGridView2.RowCount != 0)
    {
        this.Button15.Visible = true;
    }
    return Conversions.ToString(0);
}
catch (WebException exception1)
{
    ProjectData.SetProjectError(exception1);
    WebException exception = exception1;
    ProjectData.ClearProjectError();
}
return Conversions.ToString(0);
  • 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-20T01:01:17+00:00Added an answer on May 20, 2026 at 1:01 am

    This part of the code:

    try
    {
        enumerator = list.GetEnumerator();
        while (enumerator.MoveNext())
        {
            string str8 = Conversions.ToString(enumerator.Current);
            //...
        }
    }
    finally
    {
        if (enumerator is IDisposable)
        {
            (enumerator as IDisposable).Dispose();
        }
    }
    

    is basically the same as:

    foreach(var value in list)
    {
        string str8 = Conversions.ToString(value);
        //...
    }
    

    but the latter is far more readable, don’t you think ?

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

Sidebar

Related Questions

I've searched all over the net, but I could not find a solution to
I searched all over, but could not find a solution. I have a view
I searched all around, but could not find any reasonable explanation. I found <%:
I've searched all over and tried everything but I still get: invalid multibyte char
Currently I am using codeigniter 2.0.2 version. I have searched all files but not
I searched all over the internet trying to get a guidance about the security
I have searched all over the Google and StackOverFlow, but still did not find
http://lubela.sk/index.php?id=122 Can anyone help me with this error? I have searched all the web
I've searched all over for an answer to this, but cannot find any clear
So I have searched all over the place and I can not seem to

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.