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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:41:27+00:00 2026-05-22T16:41:27+00:00

I’m studying for the 70-536 exam, which is about application development for the .NET

  • 0

I’m studying for the 70-536 exam, which is about application development for the .NET framework.

I’ve bought a book to help me study, this book includes a CD which has test exams on it. Taking on the exam I encountered the following question:

Given the following C# code sample,
how could you display the contents of
the host string in the
ProcessDnsInformation method?

Code sample:

AsyncCallback callBack = new AsyncCallback(ProcessDnsInformation);
string host = Console.ReadLine();
Dns.BeginGetHostEntry(host, callBack, host);

And then I had 4 options and only one could be the correct answer(A, B, C, D):

static void ProcessDnsInformation(IAsyncResult result)
{
    Console.WriteLine(result.AsyncState);
}

static void ProcessDnsInformation(IAsyncResult result)
{
    Console.WriteLine((string)result.AsyncState);
}

static void ProcessDnsInformation(IAsyncResult result)
{
    Console.WriteLine(result.ToString());
}

static void ProcessDnsInformation(IAsyncResult result, string host)
{
    Console.WriteLine(host);
}

I went for A, because C and D are obviously wrong. To my surprise A was also wrong, the program told me the correct answer should’ve been B. Which answer would you pick as correct, and why?

  • 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-22T16:41:28+00:00Added an answer on May 22, 2026 at 4:41 pm

    Assuming result.AsyncState is declared as an object but actually contains a string, then I would say that both A and B are both correct.

    But if you are only allowed one correct answer, then you pick the one which is best and I would say that, in general, if you are returned an object, you would normally cast it back to its actual type before using it. In some cases you have to do that because the function you are calling will not accept an object, or because you need to access one of its properties, and so I guess this is probably why they reckon B is the ‘correct’ answer.

    I have not done this particular exam, but I have done another Microsoft exam and I found quite a few of the questions fell into the subjective category where I had to pick one out of two answers neither of which I really considered better. In the end, if you do enough practice tests, you learn what answer they want.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from

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.