Posted on: 2/1/2012 12:00:10 PM | Views : 248

using C#.net 2010.
I'm trying to call the extern function GetComputerName and its not working
declared in my class:
[DllImport("kernel32")] static extern int GetComputerName(string lpBuffer, ref int nSize);
and calling it here:
//find computer name int Length = 30; string computerName = GetComputerName(computerName, ref Length);
does anyone know what I'm doing wrong?
its giving me compile error "cannot implicitly convert  int to string" but not sure how to fix that
thanks
MC
...

Go to the complete details ...