The code is as follows
Copy Code
Server using System.Collections.Generic;Using System.Text;Using System.Net.Sockets;Using System.Net; Namespace Sockettest{Class Program{static void Main (string[] args){Socket Serversk = new socket
Mediator Mode (mediator): Uses a Mediation object to encapsulate a series of object interactions. The mediator makes the objects do not need to explicitly interact with the reference, which makes the coupling loose, and can independently change the
Observer Mode (OBSERVER): Defines a one-to-many dependency that allows multiple observer objects to listen to a principal object at the same time. This subject object notifies all observer objects when the state changes, enabling them to
Abstract Factory: Provides an interface to create a series of related or interdependent objects without specifying their specific classes.
Pattern implementation:
[Code]//create productaclass producta{public:virtual void Show () = 0;}; Class
Adapter mode (Adapter): Transforms the interface of one class into another interface that the customer wants. The adapter mode makes it possible for those classes that would otherwise not work together because of incompatible interfaces to work
Memo Mode (Memento): captures the internal state of an object without compromising encapsulation, and saves the state outside that object. The object can then be restored to its previously saved state.
Pattern implementation:
[Code]struct
Enjoy meta mode (Flyweight): Use sharing technology to effectively support a large number of fine-grained objects.
Four role classes:
Flyweight: The superclass or interface of all the specific classes of the class, through which the flyweight can
Factory method Mode (Factory): Defines an interface for creating an object that allows subclasses to instantiate which class, and the factory method defers the instantiation of a class to its subclasses.
The difference from a simple factory: The
Appearance mode (facade): Provides a consistent interface for a set of interfaces in a subsystem that defines a high-level interface that makes this subsystem easier to use.
Two major roles:
Appearance class facade: Know which subsystem classes
The transformation of the JSON string into a C # object is implemented here using the Atrribute method. Because of functional limitations, this version is only for JSON strings, such as "response": "Hello", "id": 21231513, "result": +, "msg": "OK.";
This example describes a C # implementation of a method that exports data to Word or Excel. Share to everyone for your reference. Specific as follows
void Outtoword () {if (DataGridView1.Rows.Count >= 1) {String tempstr = ""; Stream MyStream;
Code:
public void ProcessRequest (HttpContext context) {context. Response.ContentType = "Image/jpeg";//Create a bitmap and give the width of the specified border using (Image img=new Bitmap (80,25)) {//Create painter object, draw string using in
Using System; Using System.Data; Using System.Configuration; Using System.Web; Using System.Web.Security; Using System.Web.UI; Using System.Web.UI.WebControls; Using System.Web.UI.WebControls.WebParts; Using System.Web.UI.HtmlControls; Using
Because the work needs to study the JS Ajax, the following is the result.
There are three main parts:
First, JS part of the Friendship notice in the JS section of the $ ("#btn_login") in the return false; This can prevent the rotation of the server
Whether it is jquery or Ajax in today's discussion has been very backward, there is a lot of information on the Internet, but still a lot of novices are very confused. This article is the simplest way for beginners to demonstrate how to use jquery
C # study notes 6,
1.Structure: In addition to attributes and fields, the structure can also include methods and constructors, but cannot contain the constructor for token recognition (No parameter. Sometimes (for example, when instantiating an
C # Study Notes 3,
1.Although not necessary, we generally recommend that you put each class in its own file and name the file with the class name, you can easily find the code that defines a specific class.
2.If you do not add an access token for
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