Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "getcomputername" in [All]

Enums

.
Summary

kernel32

.

Returns ERROR_SUCCESS on success or an error code on failure. Unless only the primary computer name is requested, the buffer will be filled with a series of null-terminated strings followed by a final null terminator. To measure the required number of characters, not including the final null terminator, use a null buffer and a zero size. This function is similar to GetComputerNameEx, and delegates to it to obtain the primary computer name.

.
Summary
.

    static extern unsafe bool GetComputerName(byte* lpBuffer, long* nSize);

.

    public static extern bool GetComputerName(StringBuilder buffer, ref uint size);    

.

<DllImport("kernel32.dll", EntryPoint:="GetComputerNameW", SetLastError:=True)> _

.

Public Function GetComputerName(<MarshalAs(UnmanagedType.LPTSTR)>sb As System.Text.StringBuilder, _

.

Declare Function GetComputerName Lib "kernel32" (ByVal lpBuffer As String, ByRef nMax As Integer) As Boolean

.

The GetComputerName function retrieves the NetBIOS name of the local computer. This name is established at system startup, when the system reads it from the registry.

.

            static extern unsafe bool GetComputerName(byte* lpBuffer, long* nSize);

.

              GetComputerName(pBuffor, pSize);

.

         <DllImport("kernel32.dll", EntryPoint:="GetComputerNameW", SetLastError:=True)> _

.

         Public Function GetComputerName(<MarshalAs(UnmanagedType.LPTSTR)>sb As System.Text.StringBuilder, _

.

           GetComputerName(buffer, Size)

.

rc = GetComputerName(buff,max)

.
Documentation
[GetComputerName] on MSDN
.

<DllImport("Kernel32", CharSet:=CharSet.Unicode, EntryPoint:="GetComputerNameA", SetLastError:=True)> _

.

Private Declare Function GetComputerNameAlt Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As StringBuilder, ByVal nSize As Integer) As Integer

.

    Declare Unicode Function GetCompName2 Lib "Kernel32" Alias "GetComputerNameA" (ByVal Puffer As StringBuilder, ByRef Laenge As IntPtr) As Integer

.

    'Ret = GetComputerNameAlt(CompName, 100)

.

static extern bool GetComputerNameEx(COMPUTER_NAME_FORMAT NameType,

.

Private Shared Function GetComputerNameEx(ByVal NameType As COMPUTER_NAME_FORMAT, ByVal lpBuffer As StringBuilder, ByRef lpnSize As UInt32) As Boolean

.

    static extern bool GetComputerNameEx(COMPUTER_NAME_FORMAT NameType,

.

        success = GetComputerNameEx(COMPUTER_NAME_FORMAT.ComputerNameDnsDomain, name, ref size);

.
Documentation
[GetComputerNameEx] on MSDN

 
Access PInvoke.net directly from VS: