using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using HslCommunication.LogNet;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
MessageBox.Show("1");
}
ILogNet LogNet = new LogNetSingle(Application.StartupPath + "\\Logs\\123.txt");
/// <summary>
/// 写入日志
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
Thread rd = new Thread(start);
}
private void start()
{
for (int i = 0; i < 100; i++)
{
LogNet.WriteDebug(i.ToString());
Thread.Sleep(30);
}
}
}
}
需整理