[VB6][HELP] How to grab a username?

🚫
Exiled
Joined
Jun 24, 2008
Messages
719
Reaction score
1
Hey there.

I'm wondering how to get someones user name from the "Start" bar menu.

I know that in VB.NET it is

Code:
Environment.UserName

But, I don't know about VB6.

Does anyone know?

And is it even possible?
 
Visual Basic 6 generally doesn't support it, but according to MSDN, you can do so anyway by creating a COM class in VB.Net, and then including it in your Visual Basic 6 application. Don't mind my vague explanation.

As you can see from Tables 1 and 2, the System.Environment class provides a lot of information that isn't readily accessible from Visual Basic 6. To use the System.Environment class, you can create a simple COM wrapper class in Visual Basic .NET. Once the COM wrapper is created, you can use the System.Environment class from Visual Basic 6, VBA, ASP, VBScript, or any other environment that can use COM objects.

http://msdn.microsoft.com/en-us/library/aa719099.aspx
 
Thanks Meth0d

It actually helped

I will see if it works though, then close thread to prevent spam.
 
Back