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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:52:20+00:00 2026-06-16T06:52:20+00:00

I got this piece of code from somewhere in stackoverflow. I am unable to

  • 0

I got this piece of code from somewhere in stackoverflow. I am unable to understand it. It is used to login to youtube. Iam new to C# and OOPS. So can anyone explain me few thigs:

1) In the 3rd line

 HttpWebRequest request = GetNewRequest("https://accounts.google.com/ServiceLoginAuth", cookies);

HttpWebRequest is a class and request is a object. But why New keyword is not used after that? and What is this “GetNewRequest” ? Is it a method? most of the time we use constructor of the class there with New keyword. So can I conclude that I can use any method of the class there? There is no need to use the new keyword and the constructor?

2) In the 6th line

Dictionary<string, string> parameters = new Dictionary<string, string>

Dictionary is class and parameters is the object. But what is this <string, string> there? I never seen parameters can be passed to a class.

3) In the 7th line

{
        {"continue","https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3Dsign_in_button%26nomobiletemp%3D1%26hl%3Den_US%26next%3D%252F"},
        {"service","youtube"},{"uilel","3"},{"dsh","157212168103955870"},{"hl","en_US"},
        {"GALX","PTqcwpZb2aE"},{"pstMsg","1"},{"dnConn",""}, {"checkConnection","youtube%3A248%3A1"}, 
        {"checkedDomains","youtube"}, {"timeStmp",""}, {"secTok",""}, {"Email","username"}, {"Passwd","password"}, 
        {"signIn","Sign+in"}, {"PersistentCookie","yes"}, {"rmShown","1"}};

I can’t understand what is this? It cant fit to any syntax I read in C#. It is something I have never seen before.

COMPLETE CODE

public void Login()
{
    HttpWebRequest request = GetNewRequest("https://accounts.google.com/ServiceLoginAuth", cookies);
    request.Referer = "https://accounts.google.com/ServiceLogin?passive=true&continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3Dsign_in_button%26nomobiletemp%3D1%26hl%3Den_US%26next%3D%252F&uilel=3&hl=en_US&service=youtube";
    request.Host = "accounts.google.com";
    Dictionary<string, string> parameters = new Dictionary<string, string>{
        {"continue","https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3Dsign_in_button%26nomobiletemp%3D1%26hl%3Den_US%26next%3D%252F"},
        {"service","youtube"},{"uilel","3"},{"dsh","157212168103955870"},{"hl","en_US"},
        {"GALX","PTqcwpZb2aE"},{"pstMsg","1"},{"dnConn",""}, {"checkConnection","youtube%3A248%3A1"}, 
        {"checkedDomains","youtube"}, {"timeStmp",""}, {"secTok",""}, {"Email","username"}, {"Passwd","password"}, 
        {"signIn","Sign+in"}, {"PersistentCookie","yes"}, {"rmShown","1"}};
    HttpWebResponse response = MakeRequest(request, cookies, parameters);
    response.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-16T06:52:21+00:00Added an answer on June 16, 2026 at 6:52 am
    1. GetNewRequest would be a method that actually creates and returns the instance of HttpWebRequest. So, new is not needed before the call to GetNewRequest. new is only needed when you are calling the constructor of the type in that same line as the declaration.
    2. The <string, string> declaration after Dictionary specifies the key and value types, since Dictionary<TKey, TValue> is a generic type.
    3. That is a way of initializing a dictionary with a list of key/value pairs. It’s just syntactic sugar. See Object Initialization. It’s just there to make your life easier/code more concise. That code is equivalent to the more verbose:

    _

    Dictionary<string, string> parameters = new Dictionary<string, string>();
    parameters.Add("continue","https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3Dsign_in_button%26nomobiletemp%3D1%26hl%3Den_US%26next%3D%252F");
    parameters.Add("service","youtube");
    // etc.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this piece of Assembly code extracted from some piece of software, but
I got this piece of code from a website for randomizing a list of
I've got this piece of code from a Backbone.js tutorial from here . The
Very new to PHP. I have sucessfully got this piece of code working to
I've got this piece of code, where I gather device id from different types
I have this small piece of code I got from a friend, but i
I got this piece of code from a book viz. sams teach yourself android
I got this piece of code from Mysql 4th edition to check table existence
I've got this piece of code to toggle a side panel: $(.example_wrapper_panel_link).click(function() { $(.example_wrapper).addClass('example_wrapper_active');
so i got this piece of code. (currPosX is defined earlier) while (earliestDate <

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.