private string GetUserName()
{
try
{
string name = string.Empty;
ManagementClass mc = new ManagementClass("Win32_ComputerSystem");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
name = mo["UserName"].ToString();
}
private string GetUserName()
{
try
{
string name = string.Empty;
ManagementClass mc = new ManagementClass("Win32_ComputerSystem");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
name = mo["UserName"].ToString();
}