tailieunhanh - Programming C# 2nd Edition phần 9

Số sửa đổi được dành cho sửa lỗi. Nếu bạn sửa chữa một lỗi và chuẩn bị sẵn sàng để xác nhận rằng DLL của bạn là hoàn toàn tương thích ngược với phiên bản hiện tại, bạn nên tăng sửa đổi. Khi một ứng dụng tải một hội đồng, quy định cụ thể các phiên bản lớn và nhỏ mà nó muốn, | Programming C 2nd Edition In this case the server is assumed to be running on your local machine so the URI is http followed by the port for the server 6510 0 followed in turn by the endpoint you declared in the server theEndPoint . The remoting service should return an object representing the interface you ve requested. You can then cast that object to the interface and begin using it. Because remoting cannot be guaranteed the network might be down the host machine may not be available and so forth you should wrap the usage in a try block try Programming calc obj as Programming double sum 3 4 You now have a proxy of the Calculator operating on the server but usable on the client across the process boundary and if you like across the machine boundary. Example 19-4 shows the entire client to compile it you must include a reference to as you did with . Example 19-4. The remoting Calculator client namespace Programming CSharp using System using using using public class CalcClient public static void Main int myIntArray new int 3 Watson come here I need you. create an Http channel and register it uses port 0 to indicate won t be listening HttpChannel chan new HttpChannel 0 chan get my object from across the http channel MarshalByRefObject obj MarshalByRefObject typeof Programming http localhost 65100 theEndPoint try cast the object to our interface Programming calc obj as Programming 467 Programming C 2nd Edition use the interface to call methods double sum double difference 3 4 double product 3 4 double quotient 3 4 print the results 3 4 0 sum 3-4 0 difference 3 4 0 product 3 4 0

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.