Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting User Names
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00566514
Message ID:
00567512
Views:
12
>>>How can I get the user name if I have captured the NT login
>>>id and what other info is available?
>>
>>In addition to what Dave told, but easier, IMO, would be to use the WScript.Network object of the Windows Script Host.
LOCAL oNet AS "WScript.Network"
>>oNet = CREATEOBJECT("WScript.Network")
>>? oNet.UserName
>
>That was the user neatly disposed of, now what about the password?

The password is encrypted and stored. You'd first have to find the location and then find the encryption key. The latter would be the real trick.
>
>Would come in handy for transparent login into other systems?

Well, if the user had previously logged on to another network, for example, the WScript.Network object does have methods to map and unmap drives. If not, you'd have to use the parameters associated with the map method to provide the user name, password and update the profile.

One simple solution would be to store the user name and password (after having the user enter the password) in a table, and then encyrpt it. VFP 7.0 comes with a wrapper class and sample for the Crypto API that can do this quite easily.

>Is the Windows Script Host installed on any W9x through XP machine or does one have to do something?

It's an optional component of Win98 and has to be installed on Win95. I think that it's part of the OS in higher versions. You might want to look at the series of artciles that Ed Rauh and I wrote on the WSH for the VFUG newsletter beginning in the September 2000 issue of their newsletter. It's available on-line at www.vfug.org. The first article is an overview giving details on what OSes/SPs it's installed with and shows how to test for its presence. Since the WSH is freely re-distributable, if it isn't installed then you simple can install it.

>BTW George, whatever happened to "Foxpro first..." ?

For the sake of brevity, I dropped it during my "bizarre signature" period.

>My latin is a little rusty, so I get a bit about love and god, but what does it really say?

A very loose translation would be: Where love is, God is also. It's my personal response to the events of September 11th past.

>Lot's of questions, I know and I'm already looking forward to your replies.

You get 'em.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform