Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DETECTING NETWORK logon ID 3

Status
Not open for further replies.

petes123

Technical User
Jun 8, 2001
11
US
during logon to my application, I want VFP to tell me what the user's network logon id is and then check against a table of authorized users. Is there a way to do that on and NT4.0 network? I could have them enter a user ID and password but prefer to check it sytematically.
 
Try using sys(0)


xCad2 = Sys(0)
? ""
? "Log Info"
? ""
? "Machine : "
?? left(xcad2,at("#",xcad2,1)-1)
? "User : "
?? substr(xcad2,at("#",xcad2,1)+1,len(xcad2))
 
That work so nice. I really appreciate the help!
Thanks
Pete
 
With a Win xp operating system sys(0) show the machine user name not the Nwuser name.
Dan#User

should be Dan#dbn (dbn being my novell login id) I'd rather have a bottle in front of me than a frontal lobotomy
 
That seems to work the same as sys(0) in this situation.
It returns the windows id , not the network id
I'd rather have a bottle in front of me than a frontal lobotomy
 
Here's another variation:

oNet = CREATEOBJECT('WScript.Network')
STORE oNet.UserName TO m.UserName
RELEASE oNet
Dave S.
 
I found in another old thread that you can use
GETENV("nwusername")and assign it to a variable. This works for me. Is this a good solution?
 
LenaS,

The only problem with that method is that it may not be set for every OS, or it may be a called something different.
WinNT sets that value but the rest may not.
Dave S.
 
Hey Dave, can you give us the secret code for the passwords on there also?
 
If I could do that, I would be rich. And probably in jail.
Dave S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top