Consistently Declare objects in Webservices
2011-09-06 21:32
162 查看
1句話
不要忘記 webservice 也是一個 class
是 class 就有 constructor
以上。
不要忘記 webservice 也是一個 class
是 class 就有 constructor
以上。
protected PerformanceCounter cpuUsage;// = new PerformanceCounter("Processor", "% Processor Time", "_Total"); protected PerformanceCounter ramUsage;// = new PerformanceCounter("Memory", "Available MBytes"); //protected CounterSample sample; public monitor() { cpuUsage = new PerformanceCounter("Processor", "% Processor Time", "_Total"); ramUsage = new PerformanceCounter("Memory", "Available MBytes"); //sample = cpuUsage.NextSample(); } [WebMethod] public float getHostCpuUsage() { cpuUsage.NextValue(); Thread.Sleep(100); cpuUsage.NextValue(); Thread.Sleep(100); return cpuUsage.NextValue(); } [WebMethod] public float getHostMemUsage() { return ramUsage.NextValue(); }
相关文章推荐
- W3C 用于在 web 应用中处理文件的 API(W3C File API for representing file objects in web applications)
- RESTful Web Services in Spring 3(下)转载
- Discovery of Web Services in a Multi-Ontology and Federated Registry Environment 阅读分析
- 【摘录】Using Webservices ( SOAP ) in BREW
- Using Reporting Services SharePoint Web Parts in SQL Server
- XML Web Services in the Organization
- WCF WebHttp Services in .NET 4
- Using the Web Services and COM+ Event System in the .Net Application.
- Session State in ASP.NET Web Services
- Java Web Services in a Nutshell
- jQuery Call web services(SOAP) in SharePoint 2013
- Mindreef Ushers In Online Web Services Diagnostics (Live on SYS-CON.TV) @ JDJ
- Building contract-first web services in Spring(Chapter 9 of Spring In Action)
- Beginning POJOs: Lightweight Java Web Development Using Plain Old Java Objects in Spring, Hibernate,
- Why Web Services are needed in Industry
- Jersey - RESTful Web Services in Java.
- Send and Receive JSON objects to Web Service Methods using jQuery AJAX in ASP.Net
- WCF WebHttp Services in .NET 4
- Calling Web Services in BizTalk Server
- Jersey the RESTful Web Services in Java