Write Chinese code programs under .NET

xiaoxiao2021-03-05  28

A year ago, when you use Access database to program, create a data layer code through the vs.Net Data Designer, view the generated code, found that there are many Chinese, the table name and field name in the original database are Chinese, The program is running normally, and the relevant documentation knows that the original vs.net default code is UTF-8. Not long ago, I saw it in a blog, so I simply wrote some Chinese code to play with VS.NET, and the result is like a normal writing program. A bit weird taste, then put the code out.

Using system; namespace zhzuo.consoletest {// interface public interface will fly something {void flight ();} // Abstract class public abstract Class Bird: Flying things {// virtual method PUBLIC Virtual Void flight () { Console.writeline ("Bird Flight!");} // Abstract Attributes Public Abstract String Name {Get; Set;} // Abstract Method Public Abstract String Gets the name of the bird ();} // Specific class Public Class Hawk: Bird {Private String Variable 1; // Constructor PUBLIC Eagle (String Name) {Variable 1 = Name;} PUBLIC OVERRIDE STRING Name {Get {Return Variable 1;} Set {Variable 1 = Value;}} // Rewriting Base class method PUBLIC OVERRIDE VOID Flight () {Console.WriteLine ("Eagle in flight!");} Public override string Gets the name of the bird () {Return Variable 1;}} // Interface public interface Airplane: Song's thing {string type {get;} String Get Name ();} // Specific class PUBLIC CLASS fighter: Airplane {public string Type {Get {Return "Aircraft Type: Fighter";}} public string Get Name () {Return "fighter";} public void flight () {Console.Writeline ("fighter flight");}} public class zzconsole {[stathread] static void main (String [] args) {bird one bird = New Eagle ("Gray Eagle"); fighter aircraft = New fighter (); console.writeline (a bird. name);

转载请注明原文地址:https://www.9cbs.com/read-32190.html

New Post(0)