For getting information about processor follow step:
--
/\/ir@\/ <(.'.)>
1) Add reference "System.Management"
(For showing how to add reference click here)
2) Add name space
using System.Management;
///////////////// CODE /////////////////////
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Web.Services;
namespace UserNameusingCsharp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(System.Security.Principal.WindowsIdentity.GetCurrent().Name);
}
}
}
/////////////////////////////////////////////////////////////////
Download Code : UsernameOfPC.rar
See Also :
(For showing how to add reference click here)
2) Add name space
using System.Management;
///////////////// CODE /////////////////////
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Web.Services;
namespace UserNameusingCsharp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(System.Security.Principal.WindowsIdentity.GetCurrent().Name);
}
}
}
/////////////////////////////////////////////////////////////////
Download Code : UsernameOfPC.rar
See Also :
- How to Get operating system name using C#.net,How ...
- How to Get processor name using C#.net,How to get information about processor using C#.net
- How to upaload image with resize it, How to resize uploaded image and save
- How to get computer name using c#.net
- How to upload and save image in asp.net ?
--
/\/ir@\/ <(.'.)>
0 comments:
Post a Comment
Thanks for comment