I haven't published any articles for a long time, and it's also interesting. I suddenly felt some classes in C #. Why is its constructor invisible?In addition, these classes often only have one instance in a program. So I made an experiment with the
2. Attributes
Attribute is a familiar concept for users of Delphi and Visual Basic. The purpose of using properties is to normalize the concept of the accessor/setter [Note: the original is getter/setter], which is a widely used mode, especially in
16. switch statement
Switch statements in C # can use integer, character, enumeration, or (unlike C ++ or Java) strings. In Java and C ++, if you ignore a break statement in any case statement, other case statements may be executed. I cannot figure
25. Library
If the language does not have a library, it is useless. C # is known as having no core library, but it uses the. NET Framework library (some of them are created using C ). This article focuses on the special features of C #, rather than.
In C #, I read and write a piece of code from the INI file. In fact, this article only points out a direction and hopes that you can bypass the class.
The full text of the Code is as follows:
// Write the INI File[DllImport ("kernel32")]Private
The following is my test. I created a Class in VB and referenced it in C #. Finally, the corresponding table is obtained:
VB
C #
Currency
Decimal
Double
Double
Using System;
Using System. DirectoryServices;
Using System. Collections;
Using System. Text. RegularExpressions;
Using System. Text;
/**
* @ Author Wu Haiyan
* @ Email wuhy80-usual@yahoo.com
*-6-25 first version
*/
Namespace Wuhy. ToolBox
{
///
/
In the. Net Framework SDK documentation, the instructions for calling Windows APIs are scattered, and a little more comprehensive is about Visual Basic. net. In this article, the main points of calling APIs in C # are summarized as follows, hoping
Using System;Using System. Drawing;Using System. Collections;Using System. ComponentModel;Using System. Windows. Forms;Using System. IO;Using System. Xml;Namespace MyWindows{/// /// This example shows how to encode an Office file as an xml file and
For XML, I think everyone knows it well. I don't need to bother to describe what it is. I think XML will surely shine in the future of Web development, XML is a scalable markup language, which allows enterprises to develop their own data formats,
C # users often ask two questions: "Why should I write additional code to use features built in Windows? Why can't I complete this task for me without relevant content in the framework ?" When the Framework Team built their. NET part, they evaluated
Public class Rectangle: Shape{Protected Point m_Start;Protected Point m_End;Public Rectangle (Point start, Point end, Color fgColor){M_Start = start;M_End = end;M_Color = fgColor;}Public override void Draw (Form canvas){If (canvas =
After reading this article, disable the specified IE instance:Http://www.c-sharpcorner.com/Code/2002/Mar/CaptRunIEInstances.aspI thought of another way to do this.Modify the Registry first:HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Service \
String is the most basic data type in a variety of programming languages. It has been overwhelmed by other classes for a long time and is often disassociated (Substring, Split), torn (Join )...
Now the string is about to turn over and make a
In development, we often encounter thread examples. If a background operation is time-consuming, we can start a thread to execute that time-consuming operation, and the program continues to execute. In some cases, synchronization and collaboration
Application 1: convert to a hexadecimal string
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1 public static string ToHex (this byte B)
2 {
3 return B. ToString ("X2 ");
4}
5
6 public static string
///
/// Abbreviated Chinese character to PinYin
/// Code
/// 2004-11-30
///
/// string of Chinese characters to be converted
/// pinyin abbreviation
Public string GetPYString (string str)
{
String tempStr = "";
Foreach (char c in str)
{
If
C # has two constant types: readonly (runtime constant) and const (compilation constant ), this article compares the two types of features and describes their application scenarios.
Working PrincipleReadonly is the runtime constant. It is assigned a
Net2.0 provides the conversion function between the Gregorian calendar and the lunar calendar. The following is a few simple examples of its usage.
Using System;Using System. Collections. Generic;Using System. Text;Using System. Globalization;/***
I have made several websites, but in the development process, I usually write the business logic, and I seldom talk about this. Today, it took several minutes to help a friend draw a verification code. In fact, there are many examples on the
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.