ASP.NET 笔记-2

using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)//静态方法,不需对象即可调用
        {
            Test1 testOne=new Test1();
            Test2 testTwo = new Test2();
            testTwo.test2(testOne);
            testOne.outPut();
            ConsoleApplication2.subConsoleApplication2.Product a = new ConsoleApplication2.subConsoleApplication2.Product();
           
            Console.ReadLine();
        }
    }

    class Test1
    {
        int testInt;
        public Test1()//若构造函数位私有,则无法定义变量。因为外部无法调用构造函数。只能通过static函数调用
        {
            testInt = 10;
           
        }

        internal void outPut()
        {
            Console.WriteLine("testInt is " + testInt);
           // Console.右键可查看其定义,是个静态类,可调用其静态方法
        }
    
    }

    class Test2
    {
        int testInt;
        internal void test2(Test1 testParam)
        {
            testParam.outPut();
        }

        internal void testThis(int testIntPara)
        {
            this.testInt = testIntPara;
        }
    }

    class Test3
    {
        private void messageShow()
        {

            int testInt = 200;
            Console.WriteLine(testInt.ToString());
        }
    }

    public interface theFace
    {
         void output();
    }

    public interface otherFace
    {
         void output2();
    }
    public class Test4:theFace,otherFace
    {
        public void output()
        {
            Console.WriteLine("face1");

        }
        
        public void output2()
        {
            Console.WriteLine("face2");

        }

    }

}



namespace ConsoleApplication2
{
    namespace subConsoleApplication2
    {
        public class Product
        {
            static void outPut()
            {
                Console.WriteLine("face2");
            }
        }
    }
}


 

test.txt已经存在下的读写

子目录的遍历

子目录与目录下文件的遍历

文件夹移动、父目录、根目录显示

列出c: D: E:..等盘符,{0}表示第一个参数

foreach:集合中元素的遍历

文件的创建、拷贝、删除

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值