C # basics of learning (Summary)

1. namespace keywords Similar to the package keyword in Java, it is used to uniquely identify the scope. 2,Partial keyword The methods, structures, and excuses in the class modified by this keyword can be written separately. For example:

C # example of automatically downloading and saving files

first list the Code , and then describe the code after a period of time Protected void page_load (Object sender, eventargs e) { string strurl = "http ://"; SaveFile (strurl); } private void SaveFile (string URL) { int blocksize = 1024*100;

C # differences between struct and class

Struct type in C # Struct is a value type, which is usually used to encapsulate small correlation variable groups, such as coordinates of rectangles or features of stock items. The following example shows a simple structure declaration. Public

C # differences between class and interface and value types and reference types

1. C # What is the difference between a class and an interface? An interface is responsible for defining functions. In a project, interfaces are used to define the concepts of class, operation class, and abstract class! The class is responsible for

C # obtain the TrueType font contour and stroke information (Miscellaneous)

1. Use a list strokelist = new list () to store the information of a single stroke; 2. Use the graphicspathiterator path iterator for related operations. 3. Write and click the function and bind it to the main event (to determine whether it is

Features and uses of abstract classes and abstract methods in C # [completely resolved]

// Abstract method: it only contains the method definition, but does not have a specific implementation method. It must be implemented by its subclass or subclass. // Static methods cannot be marked as override, virtual, or abstract. That is,

C # How to remove punctuation marks and special letters from a string

1. When I first started using regular expressions, I wanted to extract punctuation marks. Later I checked out the non-continuous segments of punctuation marks. If I wanted to match them all, I had to enumerate them, which was too troublesome. Of

CSHARP, C #, GDI +

At the beginning, I want to isolate the drawn rice child box from the master form1 to write, mainly for the sake of transaction separation, and want to write in tianzikuang. in the CS file, define a method for drawing the rice box drawtianzikuang

C # nesting of two forms

Private void button5_click (Object sender, eventargs e) {form = new form (); label Label = new label (); textbox = new Textbox (); label label_content = new label (); textbox textbox_content = new Textbox (); button buttonok = new button (); button

C # JS calls the winform method, and C # JS communicates with winform

Key components: system. Windows. Forms. webbroswer Key statement: Pre-class declaration Namespace GDI ___ {[system. security. permissions. permissionset (system. security. permissions. securityaction. demand, name = "fulltrust")] [system. runtime.

C # dispose () release sequence Miscellaneous

View code Public void drawword_first (Object sender, painteventargs E){Graphics GD = E. graphics;// G. smoothingmode = smoothingmode. antialias;Graphicspath stringpath = new graphicspath ();Charinfo chars = new charinfo ();String drawwords = chars.

C # basics of learning (differences between file, fileinfo, diretory, and diretoryinfo)

What they have in common: 1. They are all used for typical operations, such as copying, moving, renaming, creating, opening, deleting, and appending objects.Ii. By default, full read/write access to new files will be granted to all users.

C # example of downloading files and converting files into data streams

List the code first, and write the description later. Protected void page_load (Object sender, eventargs e) { string file = request ["file"]; If (string. isnullorempty (File) return; string filepath = server. mappath ("~ /Download/"+ file); If

C # encryption or decryption algorithm cryptography CRC32 MD5 base64

Encryption or decryption algorithms and operations of cryptography, CRC32, MD5, and base64 Using system; using system. collections. generic; using system. text; using system. security; using system. security. cryptography; using system. data;

C #. net capture webpage content

It is very convenient to capture webpage content in ASP. NET, But it solves the encoding problem that troubles us in ASP. 1. Capture general content Three classes are required: webrequest, webresponse, and streamreader. Required namespaces: system.

Use C #. Net to rewrite the URL

URL rewriting is the process of intercepting incoming Web requests and automatically redirecting requests to other URLs. For example, if the browser sends a request for Hostname/101. aspx, the server automatically directs the request to http: //

Use C # To send mails with a free SMTP server (Gmail)

Address: http://www.cnblogs.com/skywind/archive/2007/09/21/901734.html Method 1 Bytes -------------------------------------------------------------------------------------------------------- View code // Using system. net. mail; Mailmessage message =

C # how to read and write XML files

1) XML is a popular technology. One of the main reasons why it can attract people's interest is that it is very simple and people can easily understand and use it. Every programmer can easily understand an XML file and understand its content. . Net

C # enable local logout, shutdown, and restart

[Dllimport ("user32.dll", entrypoint = "exitwindowsex", charset = charset. ANSI)]Private Static extern int exitwindowsex (INT uflags, int dwreserved ); // Log out of the computerPublic void logout (){Exitwindowsex (0, 0); // call API implementation}/

C # data packet issues that the WebServices interface provides C ++ calls

I have answered a few questions I have submitted in blog posts and csdn. I found a solution code later: Now we need to use C # As a WebServices interface for C ++ to call.WebServices has been defined (only one of the simplest web methods is

Total Pages: 5902 1 .... 3374 3375 3376 3377 3378 .... 5902 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.