Solved

how can i do windows form to prompt for password in C#.net windows application ??

Posted on 2011-03-07
4
698 Views
Last Modified: 2012-05-11
when i open abc.cs (windows form) then it prompt for Password , and if user give invalid password then it can not be login ....

how can i do this ??
0
Comment
Question by:Parth48
  • 2
4 Comments
 
LVL 12

Expert Comment

by:Hairbrush
Comment Utility
Hi

I am a bit confused.  You have a windows form, but you tagged your question as "ASP.NET" and you submitted it in the "Programming for ASP.NET" zone.  How does your Windows form interact with your ASP.NET web site?
0
 
LVL 18

Expert Comment

by:UnifiedIS
Comment Utility
It would also be helpful to know how to determine if a password was legitimate or not.  Is this Windows authentication or a user account defined in a database or something else?
0
 

Author Comment

by:Parth48
Comment Utility
No it's not windows authentication but user account defined in a database ....

how can i do this ??
0
 
LVL 12

Accepted Solution

by:
Hairbrush earned 500 total points
Comment Utility
Parth98, you didn't answer my question, only the more recent one from UnifiedIS?

If you have a Windows application that is going to call say an ASP.NET web service then the normal approach would be to make a request to your web service method having set the credentials property of the HTTPWebRequest object to the credentials that the user entered, like this:

MyHTTPRequest.Credentials = New System.Net.NetworkCredential("myusername","mypassword");

The username and password will then be passed to ASP.NET in the header of the request.  If they are valid, then the web service method will run, and if not you will get an exception which you can handle by displaying a message to the user.

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.credentials.aspx
http://msdn.microsoft.com/en-us/library/system.net.networkcredential.aspx
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now