清理无用代码
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
|
||||
@@ -6,7 +6,6 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Text;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms.DataVisualization.Charting;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
public static class ConvertHelper
|
||||
public static class ConvertHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 字节数组高低位转换
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
@@ -41,7 +37,7 @@ namespace JinYuan.Helper
|
||||
/// </summary>
|
||||
/// <param name="dgv"></param>
|
||||
/// <param name="e"></param>
|
||||
public static void DgvRowPrePaint(DataGridView dgv,string Column, object sender, DataGridViewRowPrePaintEventArgs e)
|
||||
public static void DgvRowPrePaint(DataGridView dgv, string Column, object sender, DataGridViewRowPrePaintEventArgs e)
|
||||
{
|
||||
|
||||
if (e.RowIndex >= dgv.Rows.Count - 1)
|
||||
@@ -50,7 +46,7 @@ namespace JinYuan.Helper
|
||||
|
||||
try
|
||||
{
|
||||
if(dr.Cells[Column].Value != null)
|
||||
if (dr.Cells[Column].Value != null)
|
||||
{
|
||||
if (dr.Cells[Column].Value.Equals("OK"))
|
||||
{
|
||||
@@ -66,7 +62,7 @@ namespace JinYuan.Helper
|
||||
dr.Cells[Column].Style.ForeColor = Color.Red;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -117,7 +113,7 @@ namespace JinYuan.Helper
|
||||
public static void DoubleBufferedDataGirdView(this DataGridView dgv, bool flag)
|
||||
{
|
||||
Type dgvType = dgv.GetType();
|
||||
PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
pi.SetValue(dgv, flag, null);
|
||||
}
|
||||
|
||||
@@ -130,7 +126,7 @@ namespace JinYuan.Helper
|
||||
public static void DoubleBufferedListView(this ListView lv, bool flag)
|
||||
{
|
||||
Type lvType = lv.GetType();
|
||||
PropertyInfo pi = lvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
PropertyInfo pi = lvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
pi.SetValue(lv, flag, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
using System;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using NPOI.SS.Formula.Eval;
|
||||
using NPOI.SS.UserModel;
|
||||
using NPOI.SS.Util;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -8,11 +13,6 @@ using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using NPOI.SS.UserModel;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using NPOI.SS.Formula.Eval;
|
||||
using NPOI.SS.Util;
|
||||
using NPOI.XSSF.UserModel;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
|
||||
@@ -1,79 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
public class IniFileHelper
|
||||
{
|
||||
private static string iniFilePath = "Configure.ini";
|
||||
private static string iniFilePath = "Configure.ini";
|
||||
|
||||
[DllImport("kernel32")]
|
||||
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
|
||||
[DllImport("kernel32")]
|
||||
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
|
||||
|
||||
[DllImport("kernel32")]
|
||||
private static extern long GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
|
||||
[DllImport("kernel32")]
|
||||
private static extern long GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
|
||||
|
||||
public static string ReadIniData(string Section, string Key)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(iniFilePath))
|
||||
{
|
||||
StringBuilder temp = new StringBuilder(1024);
|
||||
GetPrivateProfileString(Section, Key, "", temp, 1024, iniFilePath);
|
||||
return temp.ToString();
|
||||
}
|
||||
MessageBox.Show("节点:" + Section + ",键名:" + Key + ":读取配置文件错误!");
|
||||
return null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static string ReadIniData(string Section, string Key)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(iniFilePath))
|
||||
{
|
||||
StringBuilder temp = new StringBuilder(1024);
|
||||
GetPrivateProfileString(Section, Key, "", temp, 1024, iniFilePath);
|
||||
return temp.ToString();
|
||||
}
|
||||
MessageBox.Show("节点:" + Section + ",键名:" + Key + ":读取配置文件错误!");
|
||||
return null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool WriteIniData(string Section, string Key, string Value)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(iniFilePath))
|
||||
{
|
||||
if (WritePrivateProfileString(Section, Key, Value, iniFilePath) == 0L)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
File.Create(iniFilePath).Close();
|
||||
if (WritePrivateProfileString(Section, Key, Value, iniFilePath) == 0L)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public static bool WriteIniData(string Section, string Key, string Value)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(iniFilePath))
|
||||
{
|
||||
if (WritePrivateProfileString(Section, Key, Value, iniFilePath) == 0L)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
File.Create(iniFilePath).Close();
|
||||
if (WritePrivateProfileString(Section, Key, Value, iniFilePath) == 0L)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static void CreateIniFile(string StartupPath, string AppName)
|
||||
{
|
||||
iniFilePath = StartupPath + AppName;
|
||||
if (!Directory.Exists(StartupPath))
|
||||
{
|
||||
Directory.CreateDirectory(StartupPath);
|
||||
}
|
||||
if (!File.Exists(iniFilePath))
|
||||
{
|
||||
File.Create(iniFilePath).Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void CreateIniFile(string StartupPath, string AppName)
|
||||
{
|
||||
iniFilePath = StartupPath + AppName;
|
||||
if (!Directory.Exists(StartupPath))
|
||||
{
|
||||
Directory.CreateDirectory(StartupPath);
|
||||
}
|
||||
if (!File.Exists(iniFilePath))
|
||||
{
|
||||
File.Create(iniFilePath).Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization.Json;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using NLog;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
public class LoggerHelp
|
||||
{
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
using HslCommunication.MQTT;
|
||||
using HslCommunication;
|
||||
using HslCommunication;
|
||||
using HslCommunication.MQTT;
|
||||
using JinYuan.Models;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Security.Policy;
|
||||
using JinYuan.Models;
|
||||
using System.Text;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
@@ -86,9 +82,9 @@ namespace JinYuan.Helper
|
||||
public string Device_name = "602VIW01";
|
||||
public string Action_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 发送进出站数据
|
||||
/// </summary>
|
||||
@@ -96,7 +92,7 @@ namespace JinYuan.Helper
|
||||
/// <param name="IP"></param>
|
||||
/// <param name="Port"></param>
|
||||
/// <param name="cPQCPTDate"></param>
|
||||
public void EnterandExitSendMessge(int Station = 3)
|
||||
public void EnterandExitSendMessge(int Station = 3)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -113,7 +109,7 @@ namespace JinYuan.Helper
|
||||
PublishMessage(Topic, EnterandExitMessge("0"));
|
||||
}
|
||||
//出站
|
||||
else if (Station == 1)
|
||||
else if (Station == 1)
|
||||
{
|
||||
|
||||
PublishMessage(Topic, EnterandExitMessge("1"));
|
||||
@@ -121,7 +117,7 @@ namespace JinYuan.Helper
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
LoggerHelp.WriteError($"发送进出站数据错误,{err.Message}",err);
|
||||
LoggerHelp.WriteError($"发送进出站数据错误,{err.Message}", err);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -144,7 +140,7 @@ namespace JinYuan.Helper
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
LoggerHelp.WriteError($"发送采集项数据错误,{err.Message}",err);
|
||||
LoggerHelp.WriteError($"发送采集项数据错误,{err.Message}", err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
using System.Xml;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user