Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using GetObject
Message
De
06/11/2014 09:25:48
 
 
À
05/11/2014 11:40:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01610536
Message ID:
01610581
Vues:
50
Thanks Thomas. I have hacked together a solution which is much faster than using the GetObject() option which seems to pause for a few seconds before completing. Basically what I do is this:

1) Get the user's login name (using SYS(0) )
2) Run NET USER in a batch file with the user's login name and output the contents into a temporary text file
3) Read in the text file and extract the information required
4) Remove the temporary batch file and the temporary file

The actual command run in the batch file is then:
net user user_login_name  >  output_file.txt
The whole thing runs in under a second so is very quick and the command window is hidden so creates no screen flicker. The 2nd and 3rd lines in the subsequent output file give the user's login account full name and description as desired. The remainder of the file contains various other info related to the user's login account.

I don't know if WinDev has functions for this built-in, it is just so enormous and one doesn't always know where to look but the above works perfectly. I sent PC Soft an email asking if there is a built-in function and will let you know the result.




>I think it is the user of the active directory services, which also has an object interface called User
>
>>
>>
>>
>>TUSER_NAME = PADR( ALLTRIM( SUBSTR( SYS(0), AT( "#", SYS(0) ) + 1 ) ), 50 )
>>
>>TOBJ_Windows_User = GETOBJECT( "WinNT://" + Getenv("USERDOMAIN") + "/" + ALLTRIM( m.TUSER_NAME ) + ",User" )
>>
>>? TOBJ_Windows_User.FullName 
>>? TOBJ_Windows_User.Description
>>
>>
>>
>>What is that GETOBJECT() actually doing? I need to create this in a WinDev application and I cant find the functions I need. They might be there but I could be looking in the wrong places so perhaps understanding GETOBJECT() will show me a way.
>>
>>Or is there another way to get this info perhaps using Windows API ?
>>
>>TIA
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform