Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (0)

Powered by Vanilla. Made with Bootstrap.
[C#] System Info [Source]
  • Xin
    Posts: 3,251
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Diagnostics;
    using System.Net;
    namespace SystemInfo
    {
    class Program

    {
    static void Main(string[] args)
    {
    PerformanceCounter cpuCounter;
    PerformanceCounter ramCounter;
    cpuCounter = new PerformanceCounter();
    cpuCounter.CategoryName = \"Processor\";
    cpuCounter.CounterName = \"% Processor Time\";
    cpuCounter.InstanceName = \"_Total\";
    ramCounter = new PerformanceCounter(\"Memory\", \"Available MBytes\");

    Console.WriteLine(\"PC Name: \" + System.Environment.MachineName);
    Console.WriteLine(\"Operating System: \" + System.Environment.OSVersion);
    Console.WriteLine(\"64Bit True/False : \" + System.Environment.Is64BitOperatingSystem);
    Console.WriteLine(\"User: \" + System.Environment.UserName);
    Console.WriteLine(\"Processors: \" + System.Environment.ProcessorCount);
    Console.WriteLine(\"Domain Name: \" + System.Environment.UserDomainName);
    Console.WriteLine(\"CPU Usage: \" + cpuCounter.NextValue() + \"%\");
    Console.WriteLine(\"RAM Usage: \" + ramCounter.NextValue() + \"MB\");
    WebClient wc;
    wc = new WebClient();
    Console.WriteLine(\"IP Address: \" + wc.DownloadString(\"http://whatismyip.com/automation/n09230945.asp\"));

    Console.ReadLine();

    }
    }
    }
    Xin
  • undead
    Posts: 822
    Nice source thanks but i think this thread belongs to vb section because c# is .net language.
  • said:


    Nice source thanks but i think this thread belongs to vb section because c# is .net language.



    Oh yes I didn't notice that. This section is only for C/C++
  • Xin
    Posts: 3,251
    You do have the ability to move threads
    Xin
  • undead
    Posts: 822
    I did it once but you posted c# sources again at c/c++ section thats why im telling you :)
  • Xin
    Posts: 3,251
    I know thanks anyway bro :L
    Xin
  • Mr. P-teoMr. P-teo
    Posts: 270
    Since iv been learning C# this could help me a great deal. Lets see what i can make.
    Skype: mrpt3o
    Twitter: MrPteo


    image