资源简介
实现10路串口数据的采集,显示,解析保存,并能够实时图表显示

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace WindowsFormsApplication2
{
public interface IUpdateTxt
{
void Save(string data);
bool Start(string path string flag string header);
void Stop();
}
class UpdateTxt : IUpdateTxt
{
private string path;
private string text;
public void SetPath(string path string Index)
{
DateTime dt = DateTime.Now;
string time = string.Format(“{0:yyyyMMddHHmmssffff}“ dt);
this.path = path + “\\“ + Index + “_“ + time + “.txt“;
FileStream fs1 = new FileStream(this.path FileMode.Create);//创建写入文件
fs1.Close();
}
public void Save(string data)
{
_Save(System.DateTime.Now.ToString() + “;“ + data);
}
private void _Save(string data)
{
if (!save)
{
return;
}
if (path == null)
{
return;
}
StreamWriter sw = new StreamWriter(path true);
sw.WriteLine(data);
sw.Close();
}
private bool save = false;
public bool Start(string path string flag string header)
{
try
{
DateTime dt = DateTime.Now;
string time = string.Format(“{0:yyyyMMddHHmmssffff}“ dt);
this.path = path + “\\“ + flag + “_“ + time + “.txt“;
FileStream fs1 = new FileStream(this.path FileMode.Create);//创建写入文件
fs1.Close();
save = true;
_Save(header);
return save;
}
catch (Exception)
{
save = false;
return save;
}
}
public void Stop()
{
save = false;
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 49664 2018-05-29 17:29 WindowsFormsApplication4\.vs\WindowsFormsApplication2\v14\.suo
文件 23552 2018-05-29 15:01 WindowsFormsApplication4\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.exe
文件 38400 2018-05-29 15:01 WindowsFormsApplication4\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.pdb
文件 22688 2018-05-29 15:37 WindowsFormsApplication4\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.exe
文件 490 2015-12-02 08:23 WindowsFormsApplication4\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.exe.manifest
文件 2085 2018-05-22 16:57 WindowsFormsApplication4\WindowsFormsApplication2\daterecive.cs
文件 20842 2018-05-29 15:00 WindowsFormsApplication4\WindowsFormsApplication2\Form1.cs
文件 24107 2018-05-23 12:15 WindowsFormsApplication4\WindowsFormsApplication2\Form1.Designer.cs
文件 6189 2018-05-23 12:15 WindowsFormsApplication4\WindowsFormsApplication2\Form1.resx
文件 1452 2018-05-23 12:18 WindowsFormsApplication4\WindowsFormsApplication2\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6944 2018-05-25 17:36 WindowsFormsApplication4\WindowsFormsApplication2\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 2814 2018-05-29 15:38 WindowsFormsApplication4\WindowsFormsApplication2\obj\Debug\WindowsFormsApplication2.csproj.FileListAbsolute.txt
文件 1012 2018-05-25 14:55 WindowsFormsApplication4\WindowsFormsApplication2\obj\Debug\WindowsFormsApplication2.csproj.GenerateResource.Cache
文件 2210 2018-05-29 15:01 WindowsFormsApplication4\WindowsFormsApplication2\obj\Debug\WindowsFormsApplication2.csprojResolveAssemblyReference.cache
文件 23552 2018-05-29 15:01 WindowsFormsApplication4\WindowsFormsApplication2\obj\Debug\WindowsFormsApplication2.exe
文件 180 2018-05-25 14:55 WindowsFormsApplication4\WindowsFormsApplication2\obj\Debug\WindowsFormsApplication2.Form1.resources
文件 38400 2018-05-29 15:01 WindowsFormsApplication4\WindowsFormsApplication2\obj\Debug\WindowsFormsApplication2.pdb
文件 180 2018-05-25 14:55 WindowsFormsApplication4\WindowsFormsApplication2\obj\Debug\WindowsFormsApplication2.Properties.Resources.resources
文件 505 2018-05-21 17:52 WindowsFormsApplication4\WindowsFormsApplication2\Program.cs
文件 1356 2018-05-21 17:52 WindowsFormsApplication4\WindowsFormsApplication2\Properties\AssemblyInfo.cs
文件 2861 2018-05-21 17:52 WindowsFormsApplication4\WindowsFormsApplication2\Properties\Resources.Designer.cs
文件 5612 2018-05-21 17:52 WindowsFormsApplication4\WindowsFormsApplication2\Properties\Resources.resx
文件 1111 2018-05-21 17:52 WindowsFormsApplication4\WindowsFormsApplication2\Properties\Settings.Designer.cs
文件 249 2018-05-21 17:52 WindowsFormsApplication4\WindowsFormsApplication2\Properties\Settings.settings
文件 3803 2018-05-22 16:57 WindowsFormsApplication4\WindowsFormsApplication2\WindowsFormsApplication2.csproj
文件 1039 2018-05-21 17:52 WindowsFormsApplication4\WindowsFormsApplication2.sln
目录 0 2018-05-21 17:52 WindowsFormsApplication4\WindowsFormsApplication2\obj\Debug\TempPE
目录 0 2018-05-25 17:34 WindowsFormsApplication4\.vs\WindowsFormsApplication2\v14
目录 0 2018-05-25 17:34 WindowsFormsApplication4\WindowsFormsApplication2\bin\Debug
目录 0 2018-05-22 16:45 WindowsFormsApplication4\WindowsFormsApplication2\bin\Release
............此处省略11个文件信息
- 上一篇:C#开发Web留言板功能
- 下一篇:C# 计算器 仿windows计算器
相关资源
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
评论
共有 条评论