tailieunhanh - C# .NET Web Developer's Guide phần 5

Xây dựng các ứng dụng giao diện điều khiển để tạo ra các ứng dụng giao diện điều khiển . Các lớp CompanyList có thể chấp nhận các cuộc gọi sẽ nhận thấy từ xa mà chúng ta đã chọn cổng 8080 để lắng nghe cho sự lựa chọn khách hàng requests. | 306 Chapter 6 Remoting 6. Build the console application to create the console application. The CompanyList class can now accept calls from remote ll notice that we have chosen port 8080 to listen to for client choice of port is rather arbitary although port 80 should be used to be firewall need to remember that a port can only be registered once per see what happens when an attempt is made to register the same port twice perform the following experiment 1. In Windows Explorer find and run the host application . 2. While the console application is running run the same host application from within the Visual Studio may need to right-click the ListHost project in the Solution Explorer and select Set as Startup Project to enable the IDE to do this. 3. Figure shows the exception that occurs when the same port is reused. Figure The Exception Generated after an Attempt to Reuse a Port Creating the Client Application The client application will be a standard Windows Application with a main form but it could also be any other type of .NET source for this project is located under the ListClient directory of the CD 1. From the Visual Studio menu choose File New Project. Select Windows Application and name the new project Listclient. 2. Rename the file to . 3. Add a reference to the namespace and also to the . 4. Add the following using statements at the top of the code window to reference the relevant namespaces Remoting Chapter 6 307 using Listserver using using Channels using 5. Modify the code in the Forml constructor to appear as follows so that a new HttpChannel object is created and registered on application startup public Form1 InitializeComponent HttpChannel c new HttpChannel .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.