1. for getting information about your pc you have to add one reference to it.
2. you have to use System.Management;
so now add reference ,go to reference tab write click on it
3. click on to add reference tab., this will show below dialog box.
4. now click on ok buttton now same way add one more reference like "System.Web.Services".
5. now add new name space
using System.Management;
using System.Web.Services.Protocols;
6. now apply following code.
///////////////////// 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.Management;
using System.Web.Services.Protocols;
namespace Drive_Information
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
string computerName= System.Net.Dns.GetHostName();
lblComputerName.Text = computerName;
}
}
}
////////////////////////////////////////////////////
Download code: PCnameCshap.rar
See Also :
--
/\/ir@\/ <(.'.)>
2. you have to use System.Management;
so now add reference ,go to reference tab write click on it
3. click on to add reference tab., this will show below dialog box.
4. now click on ok buttton now same way add one more reference like "System.Web.Services".
5. now add new name space
using System.Management;
using System.Web.Services.Protocols;
6. now apply following code.
///////////////////// 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.Management;
using System.Web.Services.Protocols;
namespace Drive_Information
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
string computerName= System.Net.Dns.GetHostName();
lblComputerName.Text = computerName;
}
}
}
////////////////////////////////////////////////////
Download code: PCnameCshap.rar
See Also :
- Android Installation for beginners_Part-1
- Android Installation for beginners
- How to Resize a Partition in Windows 7 or Vista
- How to customize send to menu.
- How to change Folder background in windows 7
--
/\/ir@\/ <(.'.)>
0 comments:
Post a Comment
Thanks for comment