how to communicate with a web site
-
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.
-
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.
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
-
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
I want to try the second method(html page) but how can I get the result
-
I want to try the second method(html page) but how can I get the result
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
-
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.
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
-
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.
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.
-
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.