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
Download Visual Studio Add-In

Search Results for "MachineName" in [All]

netapi32

.

        string lpNewMachineName,

.

lpNewMachineName - (in) Pointer to a constant string that specifies the new name of the computer. If specified, the local computer name is changed as well. If this parameter is NULL, the function assumes you have already called the SetComputerNameEx function.

.

        string lpNewMachineName,

.

        DirectoryEntry directoryEntry = new DirectoryEntry("WinNT://" + Environment.MachineName);

.

    public bool AccountGetFullName(string MachineName, string AccountName, ref string FullName)

.

            if (MachineName.Length == 0 )

.

                int lngReturn = NetUserGetInfo(MachineName, AccountName, 10, out bufPtr ) ;

.

    Public Function AccountGetFullName(ByVal MachineName As String, ByVal AccountName As String, ByRef FullName As String) As Boolean

.

    If MachineName.Length = 0 Then

.

        Throw New ArgumentException("MachineName is Required")

.

        Dim lngReturn As Integer = NetUserGetInfo(MachineName, AccountName, 10, bufPtr)

.

uint lngReturn = NetUserModalsGet(@"\\" + Environment.MachineName, 0, out bufPtr);

.

    uint lngReturn = NetUserModalsGet(@"\\" + Environment.MachineName, 0, out bufPtr);

.

        string host = Environment.MachineName;

user32

.

            Process[] p = Process.GetProcessesByName( Process.GetCurrentProcess().ProcessName , Environment.MachineName );

Constants

.

    // Use PKEY_ComputerName (propkey.h)     public static PropertyKey PKEY_PNPX_MachineName = new PropertyKey( 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 0x00005001);   // VT_LPWSTR

.

        public const int CO_S_MACHINENAMENOTFOUND = 0x00080013;

.

        public const int SPAPI_E_INVALID_MACHINENAME = (int)(0x800F0220 - 0x100000000);

cfgmgr32

.

     InvalidMachinename = 0x0000002F,   // NT ONLY

winfax

.

static extern bool FaxConnectFaxServer (string MachineName, out IntPtr FaxHandle);

Structures

.

   public string pMachineName;

winspool

.

    Public pMachineName As IntPtr

userenv

.

        string pMachineName,

.

  __in      LPCTSTR pMachineName,

pdh

.

static extern UInt32 PdhLookupPerfNameByIndex(string szMachineName, uint dwNameIndex, StringBuilder szNameBuffer, ref uint pcchNameBufferSize);

setupapi

.

    ByVal MachineName As Integer, _

Enums

.

    public const int CO_S_MACHINENAMENOTFOUND = unchecked((int)0x00080013);

.

    public const int SPAPI_E_INVALID_MACHINENAME = unchecked((int)0x800F0220);

.

    Public Const CO_S_MACHINENAMENOTFOUND As Integer = CInt(&H80013)

.

    Public Const SPAPI_E_INVALID_MACHINENAME As Integer = CInt(&H800f0220UI)

secur32

.

This may be required because System.Environment.UserDomainName is broken. If the local machine has a user account that is the same name as a logged in domain user (machineName\bob & domainName\bob) UserDomainName returns the machine name, not the domain name.

mpr

.

ConnInf.RemoteName = @"\\MachineName";

.

ConnInf.RemoteName = @"\\MachineName";

advapi32

.

        IntPtr logHandle = OpenEventLog(Environment.MachineName, eventLogName);

.

         string machineName,

.

    Dim domain As String = System.Environment.MachineName

.

            String domain  = System.Environment.MachineName;

.

        static extern IntPtr OpenSCManager( string machineName, string databaseName, SCM_ACCESS dwDesiredAccess );

.

    string lpMachineName,

.

     ByVal lpMachineName As String, _

.

    string lpMachineName,

.

     ByVal lpMachineName As String, _

.

lpMachineName: The network name of the computer to be shut down. If lpMachineName is NULL or an empty string, the function shuts down the local computer.

.

    string lpMachineName,

.

     ByVal lpMachineName As String, _

.

lpMachineName: The network name of the computer to be shut down. If lpMachineName is NULL or an empty string, the function shuts down the local computer.

.

static extern TODO MachineName(TODO);

.

Declare Function MachineName Lib "advapi32.dll" (TODO) As TODO

.
Documentation
[MachineName] on MSDN
.

IntPtr logHandle = OpenEventLog(Environment.MachineName, eventlogName);

.

    public static extern IntPtr OpenSCManager(string machineName, string databaseName, uint dwAccess);

.

    Private Shared Function OpenSCManager(ByVal machineName As String, ByVal databaseName As String, ByVal desiredAccess As Int32) As IntPtr

.

    Declare Function OpenSCManager Lib "advapi32.dll" Alias "OpenSCManagerA" (ByVal lpMachineName As String, ByVal lpDatabaseName As String, ByVal dwDesiredAccess As Integer) As Integer

.

Pass in Null/Nothing for MachineName to use the local machine.

.

    public static extern IntPtr OpenSCManager( String lpMachineName, String lpDatabaseName, UInt32 dwDesiredAccess );

.

    public static extern IntPtr OpenSCManager( String lpMachineName, String lpDatabaseName, UInt32 dwDesiredAccess );

.

  static extern int RegConnectRegistry(string lpmachineName, int hKey, ref int phKResult);

.

   ByVal lpMachineName As String, _

.

   LPCTSTR lpMachineName,


 
Access PInvoke.net directly from VS: