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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:58:21+00:00 2026-05-17T19:58:21+00:00

Any help here as I’m a C# noob. The following code works fine and

  • 0

Any help here as I’m a C# noob. The following code works fine and returns 1 string ViewState2. I’d like it to return an array of ViewState2 and EventValidation2 so I can manipulate it later on. How would I convert the code below to return an array?

    public string get_status(string local_fname)
    {
        var dts_doc = new HtmlAgilityPack.HtmlDocument();
        dts_doc.Load(local_fname);

        //Pull the values
        var ViewState = dts_doc.DocumentNode.SelectSingleNode("/html[1]/body[1]/div[1]/input[4]/@value[1]");
        var EventValidation = dts_doc.DocumentNode.SelectSingleNode("/html[1]/body[1]/div[2]/input[1]/@value[1]");

        string ViewState2 = ViewState.Attributes[3].Value;
        string EventValidation2 = EventValidation.Attributes[3].Value;


        //Display the values

        //System.Console.WriteLine(ViewState.Attributes[3].Value);
        //System.Console.WriteLine(EventValidation.Attributes[3].Value);
        //System.Console.ReadKey();
        return ViewState2;
    }
  • 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-17T19:58:22+00:00Added an answer on May 17, 2026 at 7:58 pm

    If you really want an array with ViewState2 and EventValidation2 in it, you can make the following changes:

    // Notice: return value of string[] instead of string
    public string[] get_status(string local_frame);
    

    And:

    // Notice: returning an array
    return new string[] { ViewState2, EventValidation2 };
    

    That said, this is really the “quick and dirty” approach, and is not really appropriate if you’re going to want this code to be maintainable (when’s the last time you read documentation on a function that “returns an array of length 2, with a string representing X as the first element and another string representing Y as the second”?).

    Femaref’s right; the correct thing to do would be to encapsulate the information you want returned in its own type.

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

Sidebar

Related Questions

I am asking here because I haven't gotten any help from the OpenCV developers
I've gotten some help here for this piece of code, but on my end,
All, Need some help here. I am from a purely Java background and don't
Here's my button element: <button type=submit class=btn-submit><span><strong>Let Me In, please!</strong></span></button> and here's the CSS:
i am sorry to ask again since i asked something similar to this earlier,
I'm having trouble describing this issue, which is probably why I can't find the
I have a PNG image of black sock shape with a transparent background. I
I have 2 variables - a and b. I need to fill up k
I have a requirement in an application where I need to be able 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.