国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > 綜合 > 正文

Online CPU Console using a Web Control Library wit

2024-07-21 02:16:43
字體:
來源:轉載
供稿:網友
call the event viewer control by the tag prefix colon and the class name of eventlog.cs. note that we set a property from the query string in the code behind file.
display vw_eventlog.aspx file
< !-- register the wroxcontrollib assembly  -- >
<%@ register tagprefix="cpu" namespace="wroxcpuconsole.controllib" assembly="wroxcontrollib" %>

<html>
  <body>
      <!-call the event log custom control -->
      <cpu:eventlog id="eventlog1"
               runat="server"
               machine="machine">
      </cpu:eventlog>
  </body>
<html>
code behind vw_eventlog.aspx.cs file
public class vw_eventlog : system.web.ui.page
{
   //event log custom control
   protected wroxcpuconsole.controllib.eventlog eventlog1;

   private void page_load(object sender, system.eventargs e)
   {
      //set the machine property from the query string
      eventlog1.machine = request.querystring["machine"].tostring();
   }
}
event log application available in the code download
vw_process.aspx
call the process panel control by the tag prefix colon and the class name of process.cs. note that we set a property from the query string in the code behind file.
display vw_process.aspx file
< !-- register the wroxcontrollib assembly  -- >
<%@ register tagprefix="cpu" namespace="wroxcpuconsole.controllib" assembly="wroxcontrollib" %>

<html>
  <body>
      <!-call the process custom control -->
      <cpu:process id="processes"
               runat="server"
               machine="machine">
      </cpu:process>
  </body>
<html>
code behind vw_process.aspx.cs file :
public class vw_process : system.web.ui.page
{
   //process custom control
   protected wroxcpuconsole.controllib.process processes;

   private void page_load(object sender, system.eventargs e)
   {
      //set the machine property from the query string
      processes.machine = request.querystring["machine"].tostring();
   }
}
process panel application available in the code download
vw_service.aspx
call the service panel control by the tag prefix colon and the class name of services.cs. note that we set a property from the query string in the code behind file.
display .aspx file
< !-- register the wroxcontrollib assembly  -- >
<%@ register tagprefix="cpu" namespace="wroxcpuconsole.controllib" assembly="wroxcontrollib" %>

<html>
  <body>
      <!-call the service custom control -->
      <cpu:services id="service"
               runat="server"
               machine="machine">
      </cpu:services>
  </body>
<html>
code behind .aspx.cs file:
public class vw_service : system.web.ui.page
{
   //service custom control
   protected wroxcpuconsole.controllib.services service;

   private void page_load(object sender, system.eventargs e)
   {
      //set the machine property from the query string
      service.machine = request.querystring["machine"].tostring();
   }
}
service panel application available in the code download
web.config
we tie the cpu console together using the web.config file; here security is set for the entire application and any assemblies this application will execute. we impersonate the client's identity to call the assemblies, which in turn uses the client's identity to call the event log, processes, and services on any machine the user has access rights to. by setting the authentication type to windows, asp.net will automatically retrieve the username and password when the user logs in. web.config file should contain the following elements.
<configuration>
   <system.web>
      <authentication mode="windows" />
      <identity impersonate="true" />   
   </system.web>
</configuration>
iis configuration
the final step is to configure iis. in order to configure iis correctly, and separate the release version and development versions, build the release version of our asp.net web application in the program files folder instead of the inetpub folder.
open internet services manager, right-click on the default web site. choose new | virtual directory. click next, and enter an alias, such as cpuconsoleapp (do not choose the same name of the asp.net web application). browse to the asp.net web application that was moved out of inetpub/wwwroot. click finish to complete the setup.
the new virtual directory will now be viewable; right-click and select properties. click directory security | edit. uncheck all the boxes except for basic authentication, and click the edit button besides basic authentication. type a backslash ("/ ") in the domain text area. the backslash allows users of the console to control multiple domains. click ok on each of the three forms open to complete the configuration. stop and start iis to ensure proper configuration settings before viewing the application. users must be in the group of administrators on the server and the machine they connect to.
iis authentication configuration
the web application will be viewable by opening internet explorer and typing the following url into the address bar.
http://localhost/virtualdirectory/asp/vw_default.aspx
if iis is configured correctly, there will be a prompt to log in before entering the web application. use a windows 2000 account domain/username for the user name input, and the password of the account.
login prompt on entrance of the web application
conclusion
our completed online cpu console is a multi-tiered, robust, reusable application that is easily modifiable, and serves an important business purpose. in the downloadable code, connect to the vw_default.aspx web form in the asp folder to allow the user to select a machine name.
by using the online cpu console, one can easily administer services, events and processes of any machine, even those machines that are not .net framework enabled.
 
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 依安县| 古浪县| 且末县| 苗栗市| 高要市| 竹山县| 呼图壁县| 抚顺市| 蒙阴县| 富民县| 临邑县| 治县。| 惠水县| 海南省| 兴安盟| 东至县| 英山县| 博爱县| 定安县| 吉林市| 兰州市| 皋兰县| 海伦市| 马尔康县| 洞口县| 扎赉特旗| 安多县| 襄城县| 神农架林区| 富锦市| 瑞金市| 五指山市| 涟源市| 南京市| 驻马店市| 集安市| 宜昌市| 博湖县| 泰安市| 仙桃市| 毕节市|