Để đảm bảo rằng mã của chúng tôi có thể xây dựng thành công, chuyển sang xem mã bằng cách sử dụng hoặc liên kết trên bề mặt thiết kế hoặc nút tận cùng bên trái trong Solution Explorer. Xác định vị trí và mở rộng (nếu là sụp đổ) thiết kế phần phần Mã được tạo ra. Bên trong phương pháp chia sẻ Sub Main (), bạn sẽ thấy một dòng, như trong Liệt kê 4,26. | Building the Web Log Analyzer 239 Table Property Settings NAME VALUE Name LogCollector AutoLog True CanHandlePowerEvent False CanPauseAndContinue True CanShutdown False CanStop True ServiceName Web Log Collector To ensure that our code can build successfully switch to code view using either the hyperlink on the designer surface or the leftmost button in Solution Explorer. Locate and expand if it is collapsed the Component Designer Generated Code section. Inside the Shared Sub Main method you will see a line as shown in Listing . ServicesToRun New New Service1 Listing Component Designer Generated Code before modification Change this line so that it matches the one shown in Listing . Then collapse the Component Designer Generated Code section save the file and close the code window. You should now be back on the designer surface. If not double-click the file in Solution Explorer to open it. ServicesToRun New _ New LogCollector Listing Component Designer Generated Code after modification In the properties window shown in Figure there is an Add Installer hyperlink towards the bottom. In your properties window click that link to have Visual Studio automatically add an installer to your project which you can use later to install the Web Log Collector service into the SCM. 240 Project 4 Figure ServiceProcesslnstaller property settings. Visual Studio will automatically add a new file named to your project and you should now see the ProjectInstaller component design surface which contains a ServiceProcessInstaller and ServiceInstaller component. Select the ServiceProcessInstaller component so that its properties are displayed in the Properties window and change them to the ones shown in Figure . Now select the ServiceInstaller component and set its properties to the ones shown in Figure . Before we can test our installers we need .