.NET technology FAQ (10) ----- Miscellaneous

xiaoxiao2021-03-06  60

10. How does the remote calculation of. NET? The remote computing of .NET involves sending messages through the channel. Two standard channels are HTTP and TCP. Only in LANs tend to use TCP-HTTP to be used on the LAN and WAN (Internet). Support for multiple messaging formats now provides, such as SOAP (based on XML) and binary formats. By default, the HTTP channel uses SOAP (Serialization SOAP Formatter through the .NET Runture), while the TCP channel uses a binary format (Serialization Binary Formatter through the .NET Runture). But each channel can be used in any serialization format. Here is some ways to access: SingleCall. Each request from the client is served by a new object. When the request is completed, the object is discarded. You can use ASP country services in the ASP environment to save applications or sessions, making this model (no country's division) becomes national support. Singleton. All requests to clients are processed by a single server object. Client-activated object. This is the old country support (D) COM model, where the client is received by a remote object and retains this reference (to maintain the remote object's survival) until it is completed. The distributed garbage collection of objects is managed by the "Based on Rent Lifecycle". Each object has a rental time, which is disconnected from the .NET running library when arriving at this time. Objects have default update time - the successful call initiated from the client will update the rental time. The client can also update the rental time. 10.2 How to get Win32 API in .NET? Use P / Invoke. It uses technologies similar to COM interoperability, but is used to access static DLL entry points instead of COM objects. The following is an example of a C # program called Win32 MessageBox function: use system; use system.Runtime.InterOpServices;

class MainApp {[dllimport ( "user32.dll", EntryPoint = "MessageBox", SetLastError = true, CharSet = CharSet.Auto)] public static extern int MessageBox (int hWnd, String strMessage, String strCaption, uint uiType);

Public static void main () {MessageBox (0, "Hello, This Is Pinvoke In Operation!", ".NET", 0);}}

转载请注明原文地址:https://www.9cbs.com/read-119080.html

New Post(0)