Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to use Get Post in C#

How to use Get Post in C#

Scheduled Pinned Locked Moved C#
csharptutorial
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sonu J
    wrote on last edited by
    #1

    i need few demos of get post methods that will logs into any website and retrieves data from there.

    A L R V 4 Replies Last reply
    0
    • S Sonu J

      i need few demos of get post methods that will logs into any website and retrieves data from there.

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      For one sample, see here[^].

      The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick Visit the Hindi forum here.

      1 Reply Last reply
      0
      • S Sonu J

        i need few demos of get post methods that will logs into any website and retrieves data from there.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Sonu J wrote:

        i need few demos of get post methods that will logs into any website and retrieves data from there.

        ..and what's your question? You can find demo's both on this site and Google. I'd suggest using a WebBrowser component, since that would simplify cookie-handling.

        I are Troll :suss:

        1 Reply Last reply
        0
        • S Sonu J

          i need few demos of get post methods that will logs into any website and retrieves data from there.

          R Offline
          R Offline
          Ravi Bhavnani
          wrote on last edited by
          #4

          There are several examples of this to be found in articles at CodeProject, including this[^] framework to scrape data off a website using GET or POST. /ravi

          My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

          1 Reply Last reply
          0
          • S Sonu J

            i need few demos of get post methods that will logs into any website and retrieves data from there.

            V Offline
            V Offline
            VarunSharma43
            wrote on last edited by
            #5

            #region HttpPost protected string HttpPost(string url_, string contents_, bool useCredentials_, NetworkCredential creds_) { bool isSuccess = false; int noOfRetry = 0; string response = string.Empty; try { WriteToLog(string.Format("Starting HTTPPost Publishing message {0} \r\n {1}", url_, contents_)); while (!isSuccess && noOfRetry < m_noOfRetry) { WriteToLog("HTTPPost " + "Success Status :" + isSuccess.ToString() + " Retry Count: " + noOfRetry.ToString()); Uri url = new Uri(url_); HttpWebRequest _webRequest = (HttpWebRequest)WebRequest.Create(url); _webRequest.Timeout = 400000000; _webRequest.Method = "POST"; _webRequest.ContentType = "text/xml; charset=ISO-8859-1"; _webRequest.KeepAlive = true; _webRequest.Credentials = CredentialCache.DefaultNetworkCredentials; if (useCredentials_) { string password = string.Empty; string username = string.Empty; //if no credentails provided then use if (creds_ == null) { password = ConfigurationManager.AppSettings["password"] == null ? null : ConfigurationManager.AppSettings["password"].ToString(); username = ConfigurationManager.AppSettings["user"] == null ? null : ConfigurationManager.AppSettings["user"].ToString(); if (password == null || username == null) { WriteToLog(SMSConstants.INCOMPLETE_SMSGATEWAY_INFORMATION); throw new Exception(SMSConstants.INCOMPLETE_SMSGATEWAY_INFORMATION); } WriteToLog("Connecting using UserName :" + username); password = GetDecString(password); String userInfo = username + ":" + password; byte[] bt = new byte[userInfo.Length]; bt = System.Text.Encoding.UTF8.GetBytes(userInfo); string encodedData = Convert.ToBase64String(bt); String authInfo = "Basic " + encodedData; _webRequest.Headers.Set("Authorization", authInfo);

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups