Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validating userid x password
Message
From
27/02/2004 15:15:08
 
 
To
27/02/2004 14:22:09
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00881067
Message ID:
00881617
Views:
28
>Just for the record.
>
>So far I could find a great article ("The LogonUser API" http://authors.aspalliance.com/bdesmond/ArticleViewer.aspx?ArticleID=2 ) and assembled this working example.
>
> Declare Integer LogonUser In advapi32 String  lpszUsername,;
>                                       String  lpszDomain,;
>                                       String  lpszPassword,;
>                                       Integer dwLogonType,;
>                                       Integer dwLogonProvider,;
>                                       Integer @phToken
>* dwLogonProvider:
>
> #Define LOGON32_PROVIDER_DEFAULT  0
> #Define LOGON32_PROVIDER_WINNT50  3
> #Define LOGON32_PROVIDER_WINNT40  2
> #Define LOGON32_PROVIDER_WINNT35  1
>
>* dwLogonType:
>
> #Define LOGON32_LOGON_INTERACTIVE 2
> #Define LOGON32_LOGON_NETWORK     3
> #Define LOGON32_LOGON_BATCH       4
> #Define LOGON32_LOGON_SERVICE     5
>
> cUserId   = "myuserid"
> cPassword = "mypassword"
> cDomain   = "mydomain"
>
> nToken  = 0
>
> nHandle = LogonUser (cUserId                  , ;
>                      cDomain                  , ;
>                      cPassword                , ;
>                      LOGON32_LOGON_INTERACTIVE, ;
>                      LOGON32_PROVIDER_DEFAULT , ;
>                      nToken)
>
> If nHandle > 0
>    MessageBox ("Password is correct!")
> else
>    MessageBox ("Password is NOT correct!")
> endif
>
>Still on search for problems in the above aproach or other ways to accomplish the task I'm wanting to.


Fernando

Nice routine. I just tested it in XP Pro in our corporate network and it worked fine.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform