Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6817339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:02:26+00:00 2026-05-26T21:02:26+00:00

I am a complete beginner in asp.net, C#, etc… I saw this and this

  • 0

I am a complete beginner in asp.net, C#, etc…

I saw this and this

Then I try this:

using System;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.IO;
using System.Text;
using System.Net;
using System.Collections.Generic;
using System.Xml;

using System.Collections;
using System.Collections.Specialized;
using System.Diagnostics;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        Response.Write("Hello from code behind");

        PerformanceCounter cpuload = new PerformanceCounter();
        cpuload.CategoryName = "Processor";
        cpuload.CounterName = "% Processor Time";
        cpuload.InstanceName = "_Total";

        //or PerformanceCounter cpuload = new PerformanceCounter("Processor", "% Processor Time", "_Total");

        Console.WriteLine(cpuload.NextValue() + "%");

    }
}

But that only displays Hello from code behind. Why please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:02:26+00:00Added an answer on May 26, 2026 at 9:02 pm

    You’re writing to the console, which won’t work, write to the response instead (just as your string does):

    Response.Write(cpuload.NextValue().ToString() + "%");
    

    While applications types that aren’t strictly console applications can have an associated console, they’re not visible unless explicitly made so, and couldn’t be in a web application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a complete beginner to ASP.NET and need to know how do I
First off, I'm a complete beginner at C++. I'm coding something using an API,
Ok, I am a complete beginner to this, in fact I am still building
I'm a complete beginner when it comes to Jquery, Javascript etc but I've managed
I'm a (near complete) beginner, and this is my first foray into encryption -
I'm a complete beginner, and this is how I understand linking: Static linking copies
I'm still a complete beginner in the field of web development and I'm trying
I am a complete beginner in Flash & Actionscript. My pet project is this:
I'm a complete beginner in the tcl/tk world, but I've tried to research this
I'm a complete beginner in WPF so this is probably very simple. The following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.