Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Netherlands
 Boudewijn Lutgerink
 To: Ellora Rakshit
  Where is Ellora Rakshit?
 Dhaka
 Bangladesh
 Ellora Rakshit
 Tags
Subject: RE: user name for netware login
Thread ID: 22099 Message ID: 22103 # Views: 10 # Ratings: 0
Version: Visual FoxPro 7 Category: Operating Systems
Date: Wednesday, April 09, 2003 3:10:14 PM         
   


Would this help?
Code comes from new2news.com

DO decl 
DO GetNames 
DO GetNameEx 

PROCEDURE GetNames 
    nSize = 250 
    lpBuffer = SPACE(nSize) 

    IF GetComputerName (@lpBuffer, @nSize) > 0 
        lpBuffer = STRTRAN (SUBSTR (lpBuffer, 1, nSize), Chr(0),"") 
        ? "Computer: " + lpBuffer 
    ENDIF 

    nSize = 250 
    lpBuffer = SPACE(nSize) 

    IF GetUserName (@lpBuffer, @nSize) > 0 
        lpBuffer = STRTRAN (ALLTRIM(SUBSTR (lpBuffer, 1, nSize)), Chr(0),"") 
        ? "User: " + lpBuffer 
    ENDIF 

PROCEDURE GetNameEx 
    LOCAL cBuffer, nBufsize, nIndex 
    FOR nIndex=0 TO 7 
        nBufsize = 250 
        cBuffer = Repli(Chr(0), nBufsize) 
        IF GetComputerNameEx(nIndex, @cBuffer, @nBufsize) <> 0 
            ? nIndex, LEFT(cBuffer, nBufsize) 
        ENDIF 
    ENDFOR 

PROCEDURE decl 
    DECLARE INTEGER GetComputerName IN kernel32; 
        STRING  @ lpBuffer, INTEGER @ nSize 

    DECLARE INTEGER GetComputerNameEx IN kernel32; 
        INTEGER NameType, STRING @lpBuffer, INTEGER @lpnSize 

    DECLARE INTEGER GetUserName IN advapi32; 
        STRING  @ lpBuffer, INTEGER @ nSize 



Boudewijn LutgeĀ®ink
Boudewijn.Lutgerink@foxite.com
Experience is the knowledge you get immediately AFTER you actually needed it...

COMPLETE THREAD