C #4.0 impact of new features on. NET interoperability
When talking about the impact of the new C # version on. NET interoperability, We have to first talk about the new features of C #4.0.
Dynamically typed objects.
Optional and named
I'm studying WorldWind'sSource codeThe underlying layerCodeA large number of external DLL calls, including the DLL of different platforms. That is, the unmanaged DLL function is called in the hosting Language C. In the past, I also encountered such
I.Convert binary to imageMemorystream MS = new memorystream (bytes );Ms. Position = 0;Image IMG = image. fromstream (MS );Ms. Close ();This. picturebox1.image
II.Conversion between byte [] and string in C #Code
1. system. Text. unicodeencoding
In webfrom, clicking and selecting a line is simple, but it is a bit annoying in winfrom.
Remember that the two statements written in Javascript in webfrom are OK. What about winfrom? Oh, I searched for it in msdn. I can get a result! ^ O ^
Every good developer should ensure thatProgramStable Operation. Do not use try... catch to improve program performance.
However, we cannot guarantee that each segmentCodeNo error. The user interface caused by the error is unfriendly and may cause
In C #, the most flexible and hard-to-Master pointer in C and C ++ is removed. In C #, how does one provide function pointers in C/C ++? C # provides a delegate, which is a reference type inherited from the system. Delegate class. It is equivalent
Bindableattribute:
Determines whether a property supports bidirectional data binding during design.
Browsableattribute:Check whether it is displayed in the visualization designer
Categoryattribute:In the Properties window, select the category
Most of the time, we use a button to trigger an event to achieve a certain function operation, such as clicking a button to delete a database record or a batch of records. Before performing these operations, follow these steps, after confirmation,
During the university periodAlgorithmConfused, especially those sorting algorithms,You have a headache!What's wrong with people, and now I feel a little kind of kindness.Find these sorting algorithms and share them with everyone!
I. Bubble)
Below is the cookie writing
1
Httpcookie
=
New
Httpcookie (
"
Info
"
);
//
Define the cookie object and the item named info
2
Datetime dt
=
Datetime. now;
//
Define time object
3
Timespan TS
=
New
I. Condition statements
1. If statement
If (Boolean) {} else {}
2. Switch statement
Switch (expression ){
Case branch 1:
....
Break;
Case branch 2:
....
Break;
Default:
Break ;}
The expression can be string, Enum, Char, int
1.CodeStyle specifications
Item
Specifications
Description
Indent
4 spaces
If tab is used, the display length will change in different places.
Row width
Fixed
The limit is that
Overview
In my previous project, when I read values in dbdatareder, I used reader. Read () to read values one by one based on the name. Since I learned to use reflection to read data, everything became easy.
Previous practices
Define an entity
Vs.net C # Install and register the Windows service, and determine whether the service exists and starts
1. Install the service:Private void installservice (idictionary statesaver, string filepath){Try{System. serviceprocess. servicecontroller
Using
System;
Using
System. Collections. Generic;
Using
System. text;
Using
System. net. mail; Namespace Mbacsc. dataaccess{ Public Class Sendmail{ /// /// NET 2.0 send email /// /// Email sending server
The indexer allows instances of classes or structures to be indexed in the same way as arrays. The indexer is similar to an attribute, but its accessors use parameters.
In the following example, a generic class is defined and simple get and set
Two methods are provided: one is to open the Excel file directly and then read it row by row, which is slow; the other is to connect through oledb and read the Excel file as a data source.
Method 1: This method of Directly Reading cells is very
Three cycles:
Do LoopDo{} While ( );ExecutedCode, How to perform a Boolean TestIf the test result is true, run the code again.When the result is false, the loop is exited.
While LoopWhile (){}It is very similar to do loop, but there are
1,
Int N;
String STR = "XXX ";
If (Int. tryparse (STR, out n ))
{
// Number
}
Else
{
// Non-numeric
}
2,1. String PAT = @ "[\ u4e00-\ u9fa5]";RegEx Rg = new RegEx (PAT );Match MH = RG. Match (textbox1.text );If (MH. Success){// It is a Chinese
Problem description: C # remote backup of Oracle Database by calling WebService. When the backup data volume reaches GB or more, the error "Basic Connection closed: An error occurred while receiving" occurs, data backup fails.
Note: WebService has
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