| |||
[DllImport ("advapi32.dll")] public static extern bool GetUserName (StringBuilder LPBuffer, ref Int32 LPNSize); [DllImport ("kernel32.dll")] public static extern bool GetComputerName (StringBuilder LPBuffer, ref Int32 LPNSize); protected void MostrarConta () { Int32 NC, NU; StringBuilder Computador, Usuario; Computador= new StringBuilder (256); Usuario = new StringBuilder (256); NC = Computador.Capacity; NU = Usuario.Capacity; GetUserName (Usuario, ref NU); GetComputerName (Computador, ref NC); Conta.Text = "Conta : " + Usuario + '\xA'; Conta.Text+= "Computador: " + Computador; } |

