Sorry Mr. Boudewijn due to late response.
I tried with your codes but failed. I applied in XP Home. In every cases it is showing local username only.
Thereafter I visited msdn online. I have found two articles on the aforesaid subject mentioned in the following, but failed to move further. Could you help?
1. PackNALPath Method in Class SMS_NAL_Methods
2. UnPackNALPath Method in Class SMS_NAL_Methods
I would also like to ask you whether 'NWUSERNAME' in VFP 7.0 will able to meet my requirement.
Awaiting a reply.
Regards,
ER
> 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...
Hello Foxite