Online CPU Console using a Web control Library and. NET Security (3)

Source: Internet
Author: User
Tags config configuration settings iis log connect tostring
Web Call the Event Viewer control by the tag prefix colon and the class name of Eventlog.cs. This is 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. This is 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. This is 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's set for the entire application and all assemblies this application'll execute. We impersonate the client ' s identity to call the assemblies, which in turn uses the client's identity to call the event Lo g, processes, and services on any machine the user has access rights to. By setting the authentication type to Windows, asp.net'll 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 was to configure IIS. In order to configure IIS correctly, and separate the release version and development versions, builds the release version Our asp.net Web application in the Program FilesFolder instead of the InetpubFolder.
Open Internet Services Manager, right-click on the Default Web site. Choose New | Virtual Directory. Click Next, and enter an alias, such as Cpuconsoleapp(Does not choose the same name of the ASP.net Web application). Browse to the ASP.net Web application This is moved out of Inetpub\Wwwroot. Click FinishTo complete the setup.
The new Virtual Directory is viewable; Right-click and select Properties. Click Directory Security | Edit. Uncheck all of the boxes except for Basic Authentication, and click the EditButton besides Basic Authentication. Type a backslash (" \") in the DomainText area. The backslash allows users of the console to control multiple domains. Click OKOn the three forms open to complete the configuration. Stop and start IIS to ensure proper configuration settings before viewing the application. The Users must is in the group of administrators on the server and the machine they connect to.
IIS Authentication Configuration
The Web application'll is viewable by opening Internet Explorer and typing the following URL to the address bar.
Http://localhost/VirtualDirectory/ASP/vw_Default.aspx
If IIS is configured correctly, there'll be a prompt to log in before entering the Web application. Use a Windows domain\username to 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 This is easily modifiable, and serves Important business purpose. In the downloadable code, connect to the "vw_default.aspx Web Form in" 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 to any machine, even those machi Nes that are the not. NET Framework enabled.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.