
static void Main(string[] args)
{
System.IO.StreamWriter objFile = new System.IO.StreamWriter(@"History.txt",true)
objFile.WriteLine(DateTime.Now+" "+objFile.ToString())
objFile.Close()
objFile.Dispose()
Console.ReadLine()
}
信息读取
static void Main(string[] args)
{
try
{
System.IO.StreamReader objFile = new System.IO.StreamReader(@"History.txt")
Console.WriteLine(objFile.ReadToEnd())
objFile.Close()
objFile.Dispose()
Console.ReadKey()
}
catch
{
Console.WriteLine("The log file could not be found.")
Console.ReadKey()
}
}
---------------------------------------------------------------------------------------------------------------------
至于你说的合法性验证,直接读出数据进行比较就行了。
1,创建新项目,选择Windows Forms App (.NET Core)2,根据个人编码习惯,修改项目名称和位置
3,创建后就是熟悉的cs代码界面(和Framework版本的WinForm一样)
4,右键,查看设计器,就进入和熟悉的Windows Forms设计窗体
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)