using System;
using System.Collections.Generic;
using System.Text;namespace 获取文件名
{class Program{static void Main(string[] args){string s = @"c:\ss\b.txt";string ss= s.Substring(s.LastIndexOf("\\") + 1);Console.WriteLine(ss);//输入…
using System;using System.Collections.Generic;using System.Text;namespace split与join字符串处理{ class Program { static void Main(string[] args) { string s = "123--23--34--3434-444------2"; string[] c = s.…
using System;
using System.Collections.Generic;
using System.Text;namespace 抽象方法练习
{class Program{static void Main(string[] args){Computer dev = new Computer();MP3 mp3 = new MP3();YDDisk yd = new YDDisk();dev.dev = yd;dev.dev.Read();//输入是移动硬盘在…
using System;namespace 类型转换
{class Program{static void Main(string[] args){try{Student s1 = new Student();Person p = new Person();//Student s2 = (Student)p;//这样父类转子类,虽然不报错,但运行时会出错Student s = p as Student;//这样转,如果成功则有返回值…