Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than kernel32, prefix the name with the module name and a period.
Declare Function GetComputerName Lib "kernel32" (ByVal lpBuffer As String, ByRef nMax As Integer) As Boolean
User-Defined Types:
None.
Notes:
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.
Tips & Tricks:
Make sure to go in to the build properties of your project and check "Allow Unsafe Code". Second version doesn't recquest this.
Sample Code:
using System.Management;
using System.Runtime.InteropServices;
Declare Unicode Function GetCompName2 Lib "Kernel32" Alias "GetComputerNameA" (ByVal Puffer As StringBuilder, ByRef Laenge As IntPtr) As Integer
Sub Main()
Dim CompName As New StringBuilder()
Dim Ret As Integer
'Ret = GetComputerNameAlt(CompName, 100)
Ret = GetCompName2(CompName, 100)
Dim CompNameBytes() As Byte = Encoding.Unicode.GetBytes(CompName.ToString)
Dim CompNameStr As String = Encoding.Default.GetString(CompNameBytes)
Console.WriteLine("Der Computer heißt: {0}", CompNameStr)
Console.ReadLine()
End Sub
Retrieves a NetBIOS or DNS name associated with the local computer.
6/26/2021 4:19:39 AM - dauth-202.166.147.204
Retrieves a NetBIOS or DNS name associated with the local computer.
6/26/2021 4:19:39 AM - dauth-202.166.147.204
The Netbios function interprets and executes the specified network control block (NCB). The Netbios function is provided primarily for applications that were written for the NetBIOS interface and need to be ported to Windows. Applications not requiring compatibility with NetBIOS should use other interfaces, such as mailslots, named pipes, RPC, or distributed COM to accomplish tasks similar to those supported by NetBIOS. These other interfaces are more flexible and portable.
5/23/2014 9:41:50 AM - jonr@reedholm.com-71.114.254.154
Click to read this page
4/6/2008 7:23:14 AM - anonymous
TODO - a short description
3/16/2007 7:31:57 AM - anfortas.geo@yahoo.com-216.204.61.86
The SetLastError API
1/26/2016 3:27:33 AM - -124.148.167.58
ByVal is a VB keyword that specifies a variable to be passed as a parameter BY VALUE. In other words, if the function or sub changes the value of the internal variable, it does not change the value of the external variable that was passed to it.
4/25/2007 3:19:55 AM - josep1er@cmich.edu-141.209.229.179
Click to read this page
10/2/2011 2:35:57 AM - txzhgh-89.110.151.174
ByVal is a VB keyword that specifies a variable to be passed as a parameter BY VALUE. In other words, if the function or sub changes the value of the internal variable, it does not change the value of the external variable that was passed to it.
4/25/2007 3:19:55 AM - josep1er@cmich.edu-141.209.229.179
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).