Online CPU Console using a Web Control Library wit
来源:互联网 发布:win8修改mac地址 编辑:程序博客网 时间:2024/05/29 07:48
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
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.<
Online CPU Console using a Web Control Library with .NET Security(3)';return true">
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
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.<
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- Online CPU Console using a Web Control Library wit
- Wrap a User Control inside a Web Part using WSPBuilder
- zz - transcript of Defining and Using Shared Resources in a Custom Control Library
- QUESTION 169 A database has three online redo log groups with one member each. A redo log member wit
- Using a Context Menu on a Control
- Using a Console in Winform Application
- A good online study web
- Disable and enable a control using javascript
- web——仿WIT
- Using a static library in Xcode
- Mysql -update - Error Code: 1175. You are using safe update mode and you tried to update a table wit
- web console beta control your data from anywhere
- 地址收藏Oracle ATG Web Commerce Online Library
- Formatting a Flex DataGrid control using a custom
- Web Services: Building Reusable Web Components wit
- Using Dropbox files in ArcGIS Online web maps
- Cloning a running Virtual Machine using the Service Console
- cpu control
- PHP的十个高级技巧
- 微软开放.net的部分源代码(c#编译器等)
- PHP 实现多服务器共享 SESSION 数据
- 老外编的程序(二)--System.Net的示例程序
- PHP安全配置2
- Online CPU Console using a Web Control Library wit
- 构架Linux下的PHP+MySQL开发环境
- web组件的通信---浅谈事件
- 带Oracle数据库分页显示功能的留言簿
- 《.net编程先锋C#》第四章 C#类型(转)
- PHP中字体应用释疑
- 图象显示和翻转控件(用户自定义控件)--我也来凑凑热闹--(转)
- 用PHP4中的PDF扩展来创建一个PDF文档
- 《.net编程先锋C#》第三章 第一个C#应用程序(转)