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 communicate with a web site

how to communicate with a web site

Scheduled Pinned Locked Moved C#
tutorialquestion
7 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.
  • M Offline
    M Offline
    Mohsen Saad
    wrote on last edited by
    #1

    hello , I am writing an application that gets a password and a user name from the user I need to send these information to a web site to check wheter these information is correct or not then the web site should respond to my application with the result. How can I send these information to the web site and how can I get the result from it.

    J G B T 4 Replies Last reply
    0
    • M Mohsen Saad

      hello , I am writing an application that gets a password and a user name from the user I need to send these information to a web site to check wheter these information is correct or not then the web site should respond to my application with the result. How can I send these information to the web site and how can I get the result from it.

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      You should look into web services. Create a web service on the webserver that takes and username & password, and returns a bool. If you didn't want to go that route, you could use a less sophisticated method, for instance, setup an html page and pass the user name & password data in the url, for example: http://mysite.com/q?userName=john;pass=doe

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: Lies of Our Fathers: A Must-Know About Lent Judah Himango

      M 1 Reply Last reply
      0
      • J Judah Gabriel Himango

        You should look into web services. Create a web service on the webserver that takes and username & password, and returns a bool. If you didn't want to go that route, you could use a less sophisticated method, for instance, setup an html page and pass the user name & password data in the url, for example: http://mysite.com/q?userName=john;pass=doe

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: Lies of Our Fathers: A Must-Know About Lent Judah Himango

        M Offline
        M Offline
        Mohsen Saad
        wrote on last edited by
        #3

        I want to try the second method(html page) but how can I get the result

        J 1 Reply Last reply
        0
        • M Mohsen Saad

          I want to try the second method(html page) but how can I get the result

          J Offline
          J Offline
          Judah Gabriel Himango
          wrote on last edited by
          #4

          Hmm, I'm not a web developer, so maybe someone with more experience can give you a better answer than me. If I were to guess, you could simply emit some html that contains the result. Use a WebRequest to navigate to your url, then have the page emit the return value, and you can read that value back on the client. Again, there are better ways to do this. Web services seem like a good candidate.

          Tech, life, family, faith: Give me a visit. I'm currently blogging about: Lies of Our Fathers: A Must-Know About Lent Judah Himango

          1 Reply Last reply
          0
          • M Mohsen Saad

            hello , I am writing an application that gets a password and a user name from the user I need to send these information to a web site to check wheter these information is correct or not then the web site should respond to my application with the result. How can I send these information to the web site and how can I get the result from it.

            G Offline
            G Offline
            Ghazi H Wadi
            wrote on last edited by
            #5

            Hello Mohsen, although this is going to be a crosspost , but thought you might not get the answer on the other forum. here is my answer there. Hello Mohsen, your question is way general. as we don't know are you using web services or simple aspx mechanism. or is your application a windows app that refrences a web service. I suggest you try the TaskVision sample from the MSDN or download it from http://www.windowsforms.com/[^]. It should give you a great insight on how to use webservices to get what you want done. if you simply want to get the answer is authenticated or not. use the ExecuteScalar sql function if it returned a record then save the success condition to a session variable and continue to the loged in area (response.redirect) other wise redirect him back to the old one. cheers It is Illogical to define an inventor by his invention

            1 Reply Last reply
            0
            • M Mohsen Saad

              hello , I am writing an application that gets a password and a user name from the user I need to send these information to a web site to check wheter these information is correct or not then the web site should respond to my application with the result. How can I send these information to the web site and how can I get the result from it.

              B Offline
              B Offline
              Bahadir Cambel
              wrote on last edited by
              #6

              I developed a similar application ...Here is the my solution.. First , I created a web service which gets the input , then regarding to these inputs , returns the results... In the web service

              [WebMethod(Description="Login Operation")]
              public string Login(string userName,string password)
              {
              HttpWebRequest req = (HttpWebRequest) HttpWebRequest.Create("http://[www.desiredsite.com/login.aspx?name="+userName+"&password="+passWord)
              req.KeepAlive = false;
              HttpWebResponse resp = (HttpWebResponse) req.GetResponse();			
              StreamReader sr = new StreamReader(resp.GetResponseStream(), System.Text.Encoding.UTF8);	
              string all = sr.ReadToEnd();//So far you send the info, thus you get string having the result page 
              ...//In these lines of code , regarding to the html structure, you should wrap the info you need
              ...// clean up the unnecessary tags and find whether the login is succeeded or not by manipulating html
              ...
              return resultString;//This will be the web service's respond string to the application.
              
              1 Reply Last reply
              0
              • M Mohsen Saad

                hello , I am writing an application that gets a password and a user name from the user I need to send these information to a web site to check wheter these information is correct or not then the web site should respond to my application with the result. How can I send these information to the web site and how can I get the result from it.

                T Offline
                T Offline
                tonaxxl
                wrote on last edited by
                #7

                hay man what u need to do ur question is not cleare

                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