C#写一个简单的Log日志

学习 时间:2026-05-29 06:51:39 阅读:235
C#写一个简单的Log日志

最佳回答

缓慢的冬日

畅快的煎饼

2026-05-29 06:51:39

StreamWriter log = new StreamWriter(LogPath + "ceshi。txt",true); log。WriteLine("time:" + System。DateTime。Now。ToLongTimeString()); log。Close(); 其中 LogPath 为日志存储地址,如:E:/,本例输出的是一个时间。

最新回答共有2条回答

  • 温暖的西装
    回复
    2026-05-29 06:51:39

    StreamWriter log = new StreamWriter(LogPath + "ceshi。txt",true); log。WriteLine("time:" + System。DateTime。Now。ToLongTimeString()); log。Close(); 其中 LogPath 为日志存储地址,如:E:/,本例输出的是一个时间。

上一篇 随机变量X~N(-3,1),N(2,4),且X、Y相互独立,令Z=X-2Y+5,求X,Y的概率密度

下一篇 为什么是保险丝的额定电流等于或稍大于电路正常工作电流,而并非熔断电流稍大于其正常工作电流?