一个小例子
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ClaLib2;
using System.IO;
namespace Console2
{
class Program
{
static void Main(string[] args)
{
Class1 c1 = new Class1();
{
c1.Test(M2);
Console.WriteLine("ok了");
Console.ReadKey();
}
}
static void M1()
{
Console.WriteLine("当前时间为:{0}", System.DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
}
static void M2()
{
Console.WriteLine("以存到文本文件中");
File.WriteAllText(@"time.txt", System.DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ClLib3
{
public class Class1
{
public static void ChangeStr(string[] str)
{
string[] strs = str;
for (int i = 0; i < strs.Length; i++)
{
strs[i] = "【" + strs[i] + "】";
}
}
}
}