private void CopyToClipboard(BarcodeDetectedResult barcodeDetectedResult) { //Clipboard.SetText(detectedBarcode.BarcodeValue); Thread thread = new Thread(() => Clipboard.SetText(barcodeDetectedResult.BarcodeValue)); thread.SetApartmentState(ApartmentState.STA); thread.Start(); thread.Join(); }
private void ExportCSV(BarcodeDetectedResult barcodeDetectedResult) { if (string.IsNullOrEmpty(SettingService.CSVExportPath)) { SettingService.CSVExportPath = AppDomain.CurrentDomain.BaseDirectory; } var filePathName = Path.Combine(SettingService.CSVExportPath, string.Format("{0}.csv", DateTime.Now.ToString("yyyyMMdd"))); using (StreamWriter w = File.AppendText(filePathName)) { w.WriteLine($"{barcodeDetectedResult.DetectedDateTime.ToString("yyyyMMdd hh:mm:ss")},{barcodeDetectedResult.BarcodeValue}"); } }