When we need to read multiple keywords in the background, we can first read the background database into an array (separated by commas (,) when the database adds multiple keywords ):
CopyCodeCode: Public String [] STR; // Add a public array and
Escape:
CopyCode The Code is as follows: public static string escape (string Str)
{
Stringbuilder sb = new stringbuilder ();
Foreach (char C in Str)
{
SB. append (char. isletterordigit (c)
| C = '-' | C = '_' | C = '\\'
| C = '/' | C = '.')? C.
Structure:
Interface classes that customers can connect:Copy codeThe Code is as follows: class Target{Public virtual void Request (){Console. WriteLine ("common request! ");}}
Interfaces that customers can use only by using the adapter:Copy
Structure:
Memento class: the container that saves the statusCopy codeThe Code is as follows: class Memento{Public string State {get; set ;}Public Memento (string state){This. State = state;}}
Caretaker is the class for saving Memento:Copy codeThe
The main function is to set the initialization of static fields in the type. The Type constructor does not have to be defined in the class, but can have only one. Example:
Copy codeThe Code is as follows: class SomeType {
Static SomeType (){}
}
Structure:
Abstract object:
Copy codeThe Code is as follows: abstract class Component
{
Protected string name;
Public Component (string name)
{
This. name = name;
}
Public abstract void Add (Component c );
Public abstract void Remove (Component c );
CLR requires that each type be ultimately derived from the object type, as follows:
Class Typer {}=== class Typer: object {}
The above is completely equal.
All types are ultimately derived from objects. Each type has a set of basic methods:
WCF instance (with steps)
Copy codeThe Code is as follows:
This article is transferred from Baidu document and I have tried it myself. It can be used.
Using ticket booking as an Example
Create a wcf Service Application
Define a service contract in
Page initialization. interface:
When the Server name text box gets the focus, the interface (here you can change it to your login verification code ):
The list of SQL Server services can be loaded, which is also a method provided by the quiet
Array Overview
C # create an index for the array from scratch, that is, the array index starts from scratch. In C #, arrays work in a similar way as in most other popular languages. However, some differences should be noted.When declaring an array,
Copy codeThe Code is as follows: using System;
Using System. Text;
Namespace StringLengthTest
{
Class Program
{
Static void Main (string [] args)
{
String strTmp = "abcd1234 software package ";
Int I = Encoding. GetEncoding ("GB2312").
In those years, I am still studying C #.
In those years, learning C # is to have an understanding of some C # related knowledge. It will not be able to find any direction until it is necessary. For example, how can I feel useless at the beginning of
C # is an object-oriented language with basic features of object-oriented, such as abstraction, encapsulation, inheritance, and polymorphism. Learning C # apart from some basic syntaxes, you have to learn some new features, such as generics,
Three Assembly:
Main Assembly: BaseApp.exe
Interface Assembly: IBaseApplication
Plug-in assembly: TestAttri
========================================================== ========================================================== ========
In the
Copy codeThe Code is as follows: //
/// Generate jpg thumbnail bytes, which are required in my small software. So I made a function and shared it with you.
/// Why do we need to generate bytes instead of files? This is to facilitate subsequent
When I checked some information on the Internet today, I accidentally found another method, which was very convenient. I called the system API to achieve the same effect ~
Copy codeThe Code is as follows: [DllImport ("user32.dll")]
Public static
View the number of connections on all port 80
Copy codeThe Code is as follows: netstat-nat | grep-I "80" | wc-l
Sort connected IP addresses by number of connectionsCopy codeThe Code is as follows: netstat-ntu | awk '{print $5}' | cut-d:-f1 | sort |
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