I believe this is the one you wanted to use
[DllImport("kernel32.dll")]
static extern bool GetComputerName(StringBuilder lpBuffer, ref uint
lpnSize);
http://www.pinvoke.net/ is a great source of WinAPI - C# related
information, check it out.
"cloudx" <cl****@discussions.microsoft.com> wrote in message
news:F7**********************************@microsof t.com...
Hi there,
I would like to retrieve the computer name in C#, here is the piece of
code in VB:
Private Declare Function GetComputerNameAPI Lib "kernel32" Alias
"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
How do I translate to C#? thanks!