Important alert: (current site time 7/16/2013 3:55:36 AM EDT)
 

winzip icon

An Easiest Way To get ComputerName and UserName

Email
Submitted on: 12/9/1999
By: Dasari. Ravi Kumar(r&d teamworks)  
Level: Not Given
User Rating: By 17 Users
Compatibility: VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 48143
 
     It fetches the Computer Name and User Name in a Simple way
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 2 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
12/9/1999 5:33:00 AMlee

Good job. Code is self explanatory
(If this comment was disrespectful, please report it.)

 
12/9/1999 5:36:00 AMKwee

Needs some explanation
(If this comment was disrespectful, please report it.)

 
12/9/1999 5:37:00 AMSmith

Functions are very simple!
(If this comment was disrespectful, please report it.)

 
12/9/1999 7:35:00 AMLiaisons

Very nice tips! Thank You alot!!
(If this comment was disrespectful, please report it.)

 
12/13/1999 12:05:50 AMjennifer

simple way of using apis
(If this comment was disrespectful, please report it.)

 
12/13/1999 12:16:49 AMguna

good. I request you to send me info
regarding how to get freespace of the disk.u can mail me at this id.
(If this comment was disrespectful, please report it.)

 
1/5/2000 11:32:58 AMJamie

Thanks for the code. Very easy to understand and easy to implement into program.
(If this comment was disrespectful, please report it.)

 
1/27/2000 2:54:08 PMJeff Nelson

This would be great if it would work over a network, I have been looking for something like this to match users names to workstations, do yo think it could be mondified to do so?


(If this comment was disrespectful, please report it.)

 
3/13/2000 7:04:30 AMwstewart

Good Code

In NT you can use:

environ("username")

Maybe in the future you could just post the code used instead of making us download the forms and project file?
(If this comment was disrespectful, please report it.)

 
4/10/2000 11:18:01 PMIskandar

It helps me to develop my in house software for my collegue. Keep up the good work
(If this comment was disrespectful, please report it.)

 
9/27/2000 5:15:49 PMDan Messenger

Excellent !

But how do you get the username of somebody logged onto a different computer from that which you are on? (Win95 LAN)?
(If this comment was disrespectful, please report it.)

 
10/9/2001 6:42:28 PMJason

I also ask how can you get the username from a remote workstation
(If this comment was disrespectful, please report it.)

 
2/27/2002 8:10:16 PMDanny Weyand

great code simple but effective
(If this comment was disrespectful, please report it.)

 
3/19/2002 10:54:26 AMCC

I shortened your code to one function, Thought it may be of use to others.

Public Function ComputerName() As String

Dim NameSize As Long
Dim X As Long
ComputerName = Space$(32)
NameSize = Len(ComputerName)
X = GetComputerName(ComputerName, NameSize)

End Function
(If this comment was disrespectful, please report it.)

 
7/14/2002 12:43:07 PMTy O'Malley

Thank you for the submission. It was simple to understand and easy to incorporate into my current project.
(If this comment was disrespectful, please report it.)

 
3/29/2004 1:59:45 PM

i love this code, i'v been looking for weeks to find this. however may i sujest you put the code:
Text1.SelStart = Len(Text1)
in after
Text1.Text = UCase(Text1.Text)
in the
Private Sub Text1_Change()
in order to mover the curser to the end of the text box
(If this comment was disrespectful, please report it.)

 
6/11/2008 1:19:09 AMhunggeopro

Thank so much!It helps me to develop my software for my job!
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.