Results 1 to 5 of 5

Thread: Get Computer Name

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2009
    Posts
    60

    Get Computer Name

    Hi frnds tell me bow to get Computer name in VB.Net. Tell me one thing more that Computer Name & machine Name are same or different?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Get Computer Name

    Environment.MachineName:
    Quote Originally Posted by MSDN
    Gets the NetBIOS name of this local computer.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Hyperactive Member koolprasad2003's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    443

    Arrow Re: Get Computer Name

    hey ritu

    computer name and machine name are one and the same thing..
    you can get your computer name by

    Code:
    Environment.MachineName.ToString()
    regards
    MCP, MCTS, Microsoft MVP [Asp.Net/IIS]

    For more .NET development tips visit .NET Tips

    If the post is useful then please Rate it

  4. #4
    Fanatic Member
    Join Date
    Apr 2006
    Posts
    746

    Re: Get Computer Name

    Also My.Computer.Name
    ManagePC - the all-in-one PC management and inventory tool

  5. #5
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Re: Get Computer Name

    That is info of computer . refer it :
    Code:
    lblOsVersion.Text = Environment.OSVersion.ToString
    
    lblUser.Text = Environment.UserName.ToString
    
    lblRuntime.Text = Environment.Version.ToString
    
    lblUptime.Text = Mid((Environment.TickCount / 3600000), 1, 5) & " :Hours"
    
    lblSystemRoot.Text = Environment.SystemDirectory.ToString
    
    lblCompName.Text = Environment.MachineName.ToString
    
    lblCurrentDirectory.Text = Environment.CurrentDirectory.ToString
    
    lblUserDomainName.Text = Environment.UserDomainName.ToString
    
    lblWorkingSet.Text = Environment.WorkingSet.ToString
    
    lblCommandLine.Text = Environment.CommandLine.ToString
    
    For i As Integer = 0 To Environment.GetLogicalDrives.Length - 1
    
    lblGetLogicalDrives.Text += Environment.GetLogicalDrives(i)
    
    lblGetLogicalDrives.Text += " "
    
    Next
    
    '''''''''''''''''
    
    Label1.Text = "User Name"
    
    Label2.Text = "Operating System Version"
    
    Label3.Text = "Computer Name"
    
    Label4.Text = "System Root"
    
    Label5.Text = ".Net Run Time"
    
    Label6.Text = "Up Time"
    
    Label7.Text = "Current Directory"
    
    Label8.Text = "User Domain Name"
    
    Label9.Text = "Working Set"
    
    Label10.Text = "Get Command Line for this Project"
    
    Label11.Text = "Get Logical Drives"
    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width