I chose a physics course, and the assignment left by the teacher tried to write it in C. Share the program code and share it with you.
Code:
Using System;
Using System. Collections. Generic;
Using System. ComponentModel;
Using System. Data;
Using
1. Obtain the OS Version: System. Environment. OSVersion. Version
2. "device ID" set in "about" of the system"Private string GetDeviceName (){Return System. Net. Dns. GetHostName (); // ppc or smtphone}
OrPublic static string MachineName{Get{String
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text; public class BaseClass { public virtual void displayName() { Console.WriteLine("BaseClass"); } } public
In C #, when the constant symbol const is used, the compiler first finds this symbol from the metadata of the module defining the constant and directly retrieves the constant value, then embed it into the compiled IL code. Therefore, the constant
This is the original VB. NET version I wrote earlier:
Http://www.cnblogs.com/RChen/archive/2010/05/17/1737587.html
After being converted to the C # version, some refactoring is also performed. This includes modifying to a strong type and using
Public class IpHelper{// Core method: IP search/// /// Find the region where the IP is located and make sure that the web. config contains the IPData or BackIpData configuration section./// /// IP /// Public static IpLocation GetIpLocation (string
A memory overflow error occurs on the website developed with C #: "The System. OutOfMemoryException type is thrown"
Because many pages are difficult to identify the source of the problem at the beginning, the code that caused memory overflow was
How to obtain the path of the current application for Windows Form and Web Form
System. AppDomain. CurrentDomain. BaseDirectoryOrSystem. AppDomain. CurrentDomain. SetupInformation. ApplicationBase
The following are the execution results for
The website was uploaded to a. Asa file, and its suffix was changed to. rar, which then escaped my simple suffix judgment.As a result, the website is infected with Trojans. Fortunately, it is not difficult. Now the real file type has been added and
Let's take a look at card games first. A card is composed of 52 different cards. It must generate non-repeated cards during licensing and the shuffling process must be fair, that is, 52! The order of cards should be equal to the probability.
C # format the value result table
Character
Description
Example
OutputC currency
String. Format("{0: C3}", 2) $2.000 D decimal
String. Format("{0: D3}", 2) 002 E scientific notation 1.20E + 001 1.20E + 001G conventional
String. Format("{0: G}", 2)
Download Windows Script Control from Microsoft website. It is an ActiveX (R) Control, so I used Interop in. NET. After the download and installation are complete, create a C # Windows application project, select the reference node in solution
● 1. DateTime numeric typeSystem. DateTime currentTime = new System. DateTime ();1.1 take the current year, month, day, hour, minute, secondCurrentTime = System. DateTime. Now;1.2 get current yearInt Year = currentTime. Year;1.3 take the current
There are many methods for directly passing parameters in two forms, which makes it very difficult. Actually, it is not that difficult.
PASS Parameters
Method 1: declare the control as public.
Method 2: Use an intermediate class.
Method 3: Use
1. Add the app. config file to the project:
Right-click the project name and select "add"> "Add new item". In the displayed "Add new item" dialog box, select "add application configuration file "; if the project has no configuration file before, 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.