CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Grabbing Computer Name

    How can I grab the computer name? As in the name Netbios would give the system.


  2. #2
    Join Date
    Nov 1999
    Posts
    7

    Re: Grabbing Computer Name



    copy paste the code in a new application


    option Explicit

    private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (byval lpBuffer as string, nSize as Long) as Long

    private Sub Command1_Click()
    Dim ret as Long
    Dim buff as string
    buff = Space(255)

    ret = GetComputerName(buff, 255)
    MsgBox buff
    End Sub







  3. #3
    Guest

    Re: Grabbing Computer Name

    Use API's:
    For instance toget computer name
    use GetComputerName function.
    Similarly if want to get hold of the current user name then use API
    GetUserName.
    Use VB Application wizard to get to see how to use these calls as the wizard
    automatically generates the code for you.



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

Featured