Reputation: 1161
I have a windows application and I require that the user logins in the application by the username and password which were provided to the user in the website. For this purpose, firstly I check whether the user is connected to internet or not. If there is a connection, then proceeds to check whether the credentials are valid or not. So, I need to call a webservice in the windows application. How do I proceed in this?
Any examples explaining the procedure to call webservice in windows application are welcome.
Upvotes: 4
Views: 9665
Reputation: 18290
Check this answer on SO Thread and Code project article - Webservice with Win Forms and Web Forms to move further.
To consume web service in visual studio, check the steps below...
Reference:
Creating an ASP.NET web services and consuming it with a Win Form
Edit:
System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()
should get you what you want to check the internet etc..
Refer :
How do you determine if an Internet connection is available for your WinForms App?
and
What's the best way to detect an internet connection using .NET?
Upvotes: 7