コード例 #1
0
 /// <summary>
 /// 启动流盘任务
 /// </summary>
 public override void Start()
 {
     startTime   = DateTime.Now;
     currentTime = startTime.ToString("m") + "_" + Convert.ToString(startTime.Hour)
                   + "_" + Convert.ToString(startTime.Minute) + "_" + Convert.ToString(startTime.Second);
     if (FilePath != null)
     {
         _recordDone        = false;
         _previewBufferLock = new Mutex();
         txtFileStream      = new FileStream(FilePath + "\\" + currentTime + ".txt", FileMode.Create);
         _fs = new FileStream(FilePath + "\\" + currentTime + ".bin", FileMode.OpenOrCreate);
         _wt = new BinaryWriter(_fs);
         WriteInfoToTxt(txtFileStream);
         txtFileStream.Close();
         aitask.Start();
         _thdFetchAndWriteData = new Thread(ThdFetchAndWriteData);
         _thdFetchAndWriteData.Start();
     }
     else
     {
         throw new Exception("请指定文件保存路径!");
     }
 }
コード例 #2
0
 public void Start()
 {
     AITask.Start();
 }