c#学习step by step---------第一个c#程序

这篇博客介绍了如何用C#编写第一个程序,展示获取当前系统时间的步骤。通过创建一个文本文件,输入代码,然后用CSC命令编译为.exe文件,并在DOS环境中运行,展示了C#程序的基本结构和执行流程。
摘要由CSDN通过智能技术生成

学习C#语言最好的方法是用控制台编写程序,第一个程序可以是“Hello world,但是我用的是获取当前的系统时间。

1.先建立一个记事本文件命名为CS_1.TXT,输入以下的内容

using System;                      // 引入C#命名空间,这里包含很多的系统类

class Lei             // 这是我定义的第一个类,用汉语拼音

{

         static void Main()    //这是一个主程序,是csharp项目的入口点,不是一

个类的入口点

         {

                   Console.WriteLine(DateTime.Now); //在控制台上写出一行字,字

的内容是显示当前时间<

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Published 10/30/2015 8th Edition 816 pages Book 978-1-5093-0104-1 eBook 978-1-5093-0108-9 Your hands-on guide to Microsoft Visual C# fundamentals with Visual Studio 2015 Expand your expertise--and teach yourself the fundamentals of programming with the latest version of Visual C# with Visual Studio 2015. If you are an experienced software developer, you’ll get all the guidance, exercises, and code you need to start building responsive, scalable Windows 10 and Universal Windows Platform applications with Visual C#. Discover how to: Quickly start creating Visual C# code and projects with Visual Studio 2015 Work with variables, operators, expressions, and methods Control program flow with decision and iteration statements Build more robust apps with error, exception, and resource management Master the essentials of Visual C# object-oriented programming Use enumerations, structures, generics, collections, indexers, and other advanced features Create in-memory data queries with LINQ query expressions Improve application throughput and response time with asynchronous methods Decouple application logic and event handling Streamline development with new app templates Implement the Model-View-ViewModel (MVVM) pattern Build Universal Windows Platform apps that smoothly adapt to PCs, tablets, and Windows phones Integrate Microsoft Azure cloud databases and RESTful web services About You For software developers who are new to Visual C# or who are upgrading from older versions Readers should have experience with at least one programming language No prior Microsoft .NET or Visual Studio development experience required
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值