0
표시하지 않습니다 나는이 시도 그런 this 및 thisASP.NET은 : PerformanceCounter는</p> <p>... 나는 등 asp.net, C#을에 완전한 초보자입니다 아무것도
을 보았다 :
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() + "%");
}
}
을
하지만 그 표시는 Hello from code behind
뿐입니다. 왜 제발? 당신은 작동하지 않습니다 콘솔에 작성하는
오그 그 자체가 너무 분명해서 Response.Write를 사용하기 전에 ... 도움을 주셔서 감사합니다. –