RSS Forums RSS
Please support our C# advertiser: Programming Forums
Views: 4743 | Replies: 4
Reply
Join Date: Jul 2006
Posts: 41
Reputation: jigoro is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
jigoro jigoro is offline Offline
Light Poster

Help how to initiate windows login using c#

  #1  
Apr 28th, 2007
hi everyone i need a little help, im trying to create a program which ask a user a password and when it reached a max password retry it goes to windows login. when he enters the right windows login my app will try to ask again. until the correct password is given.

does anyone knows or have an idea on how to do this? thanks a lot
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2005
Location: Dundee, Scotland
Posts: 13,372
Reputation: jbennet is just really nice jbennet is just really nice jbennet is just really nice jbennet is just really nice 
Rep Power: 33
Solved Threads: 327
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: how to initiate windows login using c#

  #2  
Apr 29th, 2007
Dont think it can be done easialy.
TRY MY SUGGESTIONS AT YOUR OWN RISK

Master of puppets Im pulling your strings, blinded by me, you cant see a thing. Master! Master!
Reply With Quote  
Join Date: Apr 2004
Location: Tracy
Posts: 744
Reputation: Killer_Typo will become famous soon enough Killer_Typo will become famous soon enough 
Rep Power: 7
Solved Threads: 32
Killer_Typo's Avatar
Killer_Typo Killer_Typo is offline Offline
Master Poster

Re: how to initiate windows login using c#

  #3  
Apr 30th, 2007
what is the reasoning behind booting someone to the login screen if they dont know the password to an application?
!!!!! WARNING YOUR COMPUTER MAY BE INFECTED WITH SPYWARE!!!! PAY AN OVER PRICED AMMOUNT TO HAVE SOMTHING FIXED WE PLACED THERE IN THE FIRST PLACE!!!!!!!!!

sound familiar, know how to block yourself and keep yourself clean.
_____________________
http://www.lavasoftusa.com/ -->adaware
http://www.safer-networking.org/en/index.html -->spybot S&D
http://www.javacoolsoftware.com/spywareblaster.html -->spywareblaster
http://www.javacoolsoftware.com/spywareguard.html -->spywareguard
_____________________
and dont forget to spread the reputation to those that deserve!
Reply With Quote  
Join Date: Nov 2006
Location: Bonners Ferry, ID
Posts: 280
Reputation: JerryShaw is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 39
JerryShaw JerryShaw is offline Offline
Posting Whiz in Training

Re: how to initiate windows login using c#

  #4  
Apr 30th, 2007
Not a smart idea, and an easy way to get into a legal jam if the forced logout causes loss of data in another application.
But, if you inisit on this insanity, you could register your application to restart in the registry, then call the Win API call to force Logout which will bring up the login screen (THAT IS IF... The PC is setup to require a login). The force Logout will close all other user processes and applicaitons on its way down.

Be careful what you wish for.
Reply With Quote  
Join Date: May 2004
Posts: 5
Reputation: Kerjo is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Kerjo Kerjo is offline Offline
Newbie Poster

Solution Re: how to initiate windows login using c#

  #5  
Jan 2nd, 2008
Are you wanting to just lock the workstation, rather than log the user out? If so, you can do this somewhere in your class:
  1.  
  2. [DllImport("user32.dll")]
  3. public static extern void LockWorkStation();

And then just called LockWorkStation() like any other method.

I wouldn't suggest forcing a logout like other said, so give this a shot.
Last edited by Kerjo : Jan 2nd, 2008 at 11:37 pm. Reason: Hopefully adding language to code
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 12:23 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC