Browse Source

提交签字版

master
胡超1 1 year ago
parent
commit
4b844e536b
  1. 56
      DevicesService/Commen/ScriptCallbackObject.cs
  2. 49
      DevicesService/Commen/TcpServer.cs
  3. 241
      DevicesService/Commen/Util.cs
  4. 11
      DevicesService/Devices/HScamera.cs
  5. 205
      DevicesService/Devices/SignDll.cs
  6. 8
      DevicesService/DevicesService.csproj
  7. 3
      DevicesService/Program.cs
  8. 12
      DevicesService/Properties/launchSettings.json

56
DevicesService/Commen/ScriptCallbackObject.cs

@ -28,6 +28,7 @@ using System.Numerics;
using System.Web;
using NAudio.Wave.SampleProviders;
using System.Configuration;
using System.Diagnostics;
namespace DevicesService.Common
{
@ -147,11 +148,8 @@ namespace DevicesService.Common
// }
// }
//}
Task.Run(() =>
{
text = text.Replace("(", "").Replace(")", "、");
speech.Speak(text);
});
speech.SpeakAsync(text);
}
catch { }
}
@ -207,14 +205,6 @@ namespace DevicesService.Common
string newdata = Util.CompressPictures(fileInfo);
//转换
string base64 = Util.ImgToBase64String(newdata);
//Task.Run(async () =>
//{
// UploadInfoByFile(url, data);
//});
//@event5.WaitOne();
//Regex re = new Regex(@"(((?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(:[0-9]+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)");
//MatchCollection mc = re.Matches(url);//获取的是一个数组
//string imgurl = mc[0].ToString() + "://" + mc[1].ToString() + urlP;
return base64;
}
else
@ -222,16 +212,11 @@ namespace DevicesService.Common
data = hScamera.openCamera2();
if (!string.IsNullOrEmpty(data))
{
string base64 = Util.ImgToBase64String(data);
//Task.Run(async () =>
//{
// UploadInfoByFile(url, data);
//});
//@event5.WaitOne();
//Regex re = new Regex(@"(((?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(:[0-9]+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)");
//MatchCollection mc = re.Matches(url);//获取的是一个数组
//string imgurl = mc[0].ToString() + "://" + mc[1].ToString() + urlP;
FileInfo fileInfo = new FileInfo(data);
//压缩
string newdata = Util.CompressPictures(fileInfo);
//转换
string base64 = Util.ImgToBase64String(newdata);
return base64;
}
else
@ -331,13 +316,7 @@ namespace DevicesService.Common
{
FileStream fs1 = fileInfo.OpenRead();
fs1.Close();
//string base64 = Util.ConvertImageToBase64(sourcepaht);
Task.Run(async () =>
{
UploadInfoByFile(url, sourcepaht);
});
@event5.WaitOne();
File.Delete(sourcepaht);
string base64 = Util.ImgToBase64StringSign(sourcepaht);
int width = 800;
int height = 394;
using (Bitmap blankImage = new Bitmap(width, height))
@ -351,26 +330,22 @@ namespace DevicesService.Common
// 保存图片到文件系统
blankImage.Save(sourcepaht);
}
Regex re = new Regex(@"(((?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(:[0-9]+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)");
MatchCollection mc = re.Matches(url);//获取的是一个数组
string imgurl = mc[0].ToString() + "://" + mc[1].ToString() + urlP;
//关闭签字版
//SignDll.CloseComDevice();
return "{\"callback\":\"" + callback + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + imgurl + "\"}";
return base64;
}
else
{
return "{\"callback\":\"" + callback + "\",\"message\":\"success\",\"code\":\"400\",\"status\":false,\"data\":\"" + "用户未签字或签字不规范" + "\"}";
return Util.str2Base64("400");
}
}
else
{
return "{\"callback\":\"" + callback + "\",\"message\":\"success\",\"code\":\"400\",\"status\":false,\"data\":\"" + "用户未签字或签字不规范" + "\"}";
return Util.str2Base64("400");
}
}
catch (Exception ex)
{
return "{\"callback\":\"" + callback + "\",\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}";
Log.Info("获取签字版数据异常:" + ex.Message);
return Util.str2Base64("400");
}
}
@ -491,8 +466,9 @@ namespace DevicesService.Common
if (!string.IsNullOrEmpty(url) && !isopen)
{
string filename = Path.GetFileName(srpath);
string path = ConfigurationManager.AppSettings["rootPath"].ToString();
return path + "Record/" + filename;
string path = ConfigurationManager.AppSettings["rootPath"].ToString() + "Record/" + filename;
Log.Info("结束录音上传文件" + path);
return path;
}
else if (isopen)//开始录音
{

49
DevicesService/Commen/TcpServer.cs

@ -16,6 +16,8 @@ using System.Drawing;
using System.IO.Ports;
using System.IO;
using System.Reflection;
using System.Buffers.Text;
using System.Globalization;
namespace DevicesService.Commen
{
/// <summary>
@ -25,7 +27,7 @@ namespace DevicesService.Commen
{
public static List<TcpClient> clients = new List<TcpClient>();
private static ScriptCallbackObject scriptCallback = new ScriptCallbackObject();
public static void Start()
public void Start()
{
try
{
@ -54,6 +56,8 @@ namespace DevicesService.Commen
public static void SendDataWithHeader(TcpClient client, string message)
{
try
{
if (client != null)
{
byte[] messageBytes = Encoding.UTF8.GetBytes(message);
byte[] header = BitConverter.GetBytes(messageBytes.Length);
@ -63,6 +67,7 @@ namespace DevicesService.Commen
NetworkStream stream = client.GetStream();
stream.Write(data, 0, data.Length);
}
}
catch (Exception ex) { Console.WriteLine(ex.Message); }
finally { }
}
@ -72,6 +77,8 @@ namespace DevicesService.Commen
/// </summary>
/// <param name="state"></param>
public static void SendHelloMessage(object state)
{
try
{
foreach (TcpClient client in clients)
{
@ -87,6 +94,9 @@ namespace DevicesService.Commen
}
}
}
catch { }
finally { }
}
/// <summary>
/// 读取客户端信息
@ -95,6 +105,8 @@ namespace DevicesService.Commen
public static void ReceiveMessage(object state)
{
TcpClient client = (TcpClient)state;
if (client != null)
{
NetworkStream stream = client.GetStream();
while (true)
@ -296,39 +308,7 @@ namespace DevicesService.Commen
#region 获取签字版数据
try
{
string sourcepaht = Environment.CurrentDirectory + "\\fiveInch.png";
FileInfo fileInfo = new FileInfo(sourcepaht);
if (fileInfo.Exists)
{
double size = fileInfo.Length / 1024.0;
if (size > 10)
{
FileStream fs1 = fileInfo.OpenRead();
fs1.Close();
resultback = Util.ImgToBase64String(sourcepaht);
int width = 800;
int height = 394;
using (Bitmap blankImage = new Bitmap(width, height))
{
// 设置图片背景为完全透明
using (Graphics g = Graphics.FromImage(blankImage))
{
// 使用白色背景填充图片
g.Clear(Color.Transparent);
}
// 保存图片到文件系统
blankImage.Save(sourcepaht);
}
}
else
{
resultback = Util.str2Base64("400");
}
}
else
{
resultback = Util.str2Base64("400");
}
resultback = scriptCallback.GetSignData(data, callback);
Log.Info("获取签字版数据 返回数据:" + resultback);
//base64 = Util.str2Base64(resultback);
//向com对方发送数据
@ -395,6 +375,7 @@ namespace DevicesService.Commen
finally { }
}
}
}
/// <summary>
/// 解析包头里面有多少字节

241
DevicesService/Commen/Util.cs

@ -71,6 +71,78 @@ namespace DevicesService.Common
}
}
/// <summary>
/// 文件转Base64码
/// </summary>
/// <param name="fileLocation"></param>
/// <returns></returns>
public static string ImgToBase64StringSign(string fileLocation)
{
MemoryStream ms = new MemoryStream();
try
{
if (System.IO.File.Exists(fileLocation))
{
Bitmap bmp = new Bitmap(@fileLocation);
//BitmapFlip(90, ref bmp);
bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] arr = new byte[ms.Length];
ms.Position = 0;
ms.Read(arr, 0, (int)ms.Length);
ms.Close();
bmp.Dispose();
File.Delete(fileLocation);
return Convert.ToBase64String(arr);
}
return "";
}
catch (Exception ex)
{
return ex.Message;
}
finally
{
ms.Close();
}
}
/// <summary>
/// 文件转Base64码
/// </summary>
/// <param name="fileLocation"></param>
/// <returns></returns>
public static string ImgToBase64StringBySign(string fileLocation)
{
MemoryStream ms = new MemoryStream();
try
{
if (System.IO.File.Exists(fileLocation))
{
Bitmap bmp1 = new Bitmap(fileLocation);
Bitmap bmp = CutImageWhitePart(bmp1, 10);//new Bitmap(@fileLocation);
BitmapFlip(90, ref bmp);
bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] arr = new byte[ms.Length];
ms.Position = 0;
ms.Read(arr, 0, (int)ms.Length);
ms.Close();
bmp.Dispose();
bmp1.Dispose();
File.Delete(fileLocation);
return Convert.ToBase64String(arr);
}
return "";
}
catch (Exception ex)
{
return ex.Message;
}
finally
{
ms.Close();
}
}
/// <summary>
/// 图像翻转,基于图像中心
/// </summary>
@ -409,5 +481,174 @@ namespace DevicesService.Common
string base64String = Convert.ToBase64String(fileBytes);
return base64String;
}
/// <summary>
/// 图片处理成电子签名大小
/// </summary>
/// <param name="originalImagePath"></param>
/// <param name="resizedImagePath"></param>
public static void ResizeImage(string originalImagePath, string resizedImagePath)
{
int width = 72;
int height = 72;
using (Image originalImage = Image.FromFile(originalImagePath))
{
// 创建一个新的画布,在其上绘制调整大小后的图片
using (Bitmap resizedImage = new Bitmap(width, height))
{
using (Graphics graphics = Graphics.FromImage(resizedImage))
{
// 设置绘图质量
graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
// 清除背景并填充白色
graphics.Clear(Color.White);
graphics.DrawImage(originalImage, new Rectangle(0, 0, width, height), new Rectangle(0, 0, originalImage.Width, originalImage.Height), GraphicsUnit.Pixel);
// 保存调整大小后的图片
resizedImage.Save(resizedImagePath, ImageFormat.Png);
}
}
}
}
/// <summary>
/// 剪去图片空余白边
/// </summary>
/// <param name="FilePath">源文件</param>
/// <param name="WhiteBarRate">保留空白边比例</param>
public static Bitmap CutImageWhitePart(Bitmap bmp, int WhiteBarRate)
{
int top = 0, left = 0;
int right = bmp.Width, bottom = bmp.Height;
Color white = Color.White;
//寻找最上面的标线,从左(0)到右,从上(0)到下
for (int i = 0; i < bmp.Height; i++)//行
{
bool find = false;
for (int j = 0; j < bmp.Width; j++)//列
{
Color c = bmp.GetPixel(j, i);
if (IsWhite(c))
{
top = i;
find = true;
break;
}
}
if (find) break;
}
//寻找最左边的标线,从上(top位)到下,从左到右
for (int i = 0; i < bmp.Width; i++)//列
{
bool find = false;
for (int j = top; j < bmp.Height; j++)//行
{
Color c = bmp.GetPixel(i, j);
if (IsWhite(c))
{
left = i;
find = true;
break;
}
}
if (find) break; ;
}
//寻找最下边标线,从下到上,从左到右
for (int i = bmp.Height - 1; i >= 0; i--)//行
{
bool find = false;
for (int j = left; j < bmp.Width; j++)//列
{
Color c = bmp.GetPixel(j, i);
if (IsWhite(c))
{
bottom = i;
find = true;
break;
}
}
if (find) break;
}
//寻找最右边的标线,从上到下,从右往左
for (int i = bmp.Width - 1; i >= 0; i--)//列
{
bool find = false;
for (int j = 0; j <= bottom; j++)//行
{
Color c = bmp.GetPixel(i, j);
if (IsWhite(c))
{
right = i;
find = true;
break;
}
}
if (find) break;
}
int iWidth = right - left;
int iHeight = bottom - left;
int blockWidth = Convert.ToInt32(iWidth * WhiteBarRate / 100);
bmp = Cut(bmp, left - blockWidth, top - blockWidth, right - left + 2 * blockWidth, bottom - top + 2 * blockWidth);
return bmp;
}
/// <summary>
/// 2014.6.13 来源于网络的一个函数
/// </summary>
/// <param name="b"></param>
/// <param name="StartX"></param>
/// <param name="StartY"></param>
/// <param name="iWidth"></param>
/// <param name="iHeight"></param>
/// <returns></returns>
public static Bitmap Cut(Bitmap b, int StartX, int StartY, int iWidth, int iHeight)
{
if (b == null)
{
return null;
}
int w = b.Width;
int h = b.Height;
if (StartX >= w || StartY >= h)
{
return null;
}
if (StartX + iWidth > w)
{
iWidth = w - StartX;
}
if (StartY + iHeight > h)
{
iHeight = h - StartY;
}
try
{
Bitmap bmpOut = new Bitmap(iWidth, iHeight, PixelFormat.Format24bppRgb);
Graphics g = Graphics.FromImage(bmpOut);
g.DrawImage(b, new Rectangle(0, 0, iWidth, iHeight), new Rectangle(StartX, StartY, iWidth, iHeight), GraphicsUnit.Pixel);
g.Dispose();
return bmpOut;
}
catch
{
return null;
}
}
/// <summary>
/// 2014.6.12 判断白色与否,非纯白色
/// </summary>
/// <param name="c"></param>
/// <returns></returns>
public static bool IsWhite(Color c)
{
if (c.R < 245 || c.G < 245 || c.B < 245)
return true;
else return false;
}
}
}

11
DevicesService/Devices/HScamera.cs

@ -77,7 +77,6 @@ namespace DevicesService.Devices
this.modeIdx = selectMode;
}
/// <summary>
/// 打开高拍仪
/// </summary>
@ -87,19 +86,19 @@ namespace DevicesService.Devices
try
{
string filename = string.Empty;
//初始化高拍仪
if (m_vDevice.Count == 0)
{
DevChangeCallBack = new ELOAM_DEVCHANGECALLBACK(DEVCHANGECALLBACK);
EloamDll.EloamGlobal_InitDevs(DevChangeCallBack, IntPtr.Zero);
EloamDll.EloamGlobal_VideoCapInit();
EloamDll.EloamGlobal_InitFaceDetect();
//EloamDll.EloamGlobal_InitFaceDetect();
}
//打开高拍仪
EloamDll.EloamVideo_Release(m_hVideo);
HELOAMDEVICE hDev = m_vDevice[devIdx];
m_hVideo = EloamDll.EloamDevice_CreateVideo(
hDev, resIdx, modeIdx, null, (IntPtr)0, null, (IntPtr)0, 0, 2);
//开始拍照
HELOAMIMAGE hImg = EloamDll.EloamVideo_CreateImage(
m_hVideo, 0, m_hView);
@ -197,7 +196,11 @@ namespace DevicesService.Devices
}
}
/// <summary>
/// base64转文件
/// </summary>
/// <param name="base64String"></param>
/// <param name="filePath"></param>
public void ConvertFromBase64ToImage(string base64String, string filePath)
{
// 将Base64字符串转换为字节数组

205
DevicesService/Devices/SignDll.cs

@ -1,4 +1,5 @@
using Functions.FileExt;
using DevicesService.Commen;
using Functions.FileExt;
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
using System;
using System.Drawing;
@ -33,6 +34,8 @@ namespace DevicesService.Devices
public static int status = -1;
private static Bitmap bitmap = new Bitmap(594, 392);
public SignDll()
{
try
{
endPos = new PointF(-1F, -1f);
beginPos = new PointF(-1F, -1f);
@ -45,6 +48,9 @@ namespace DevicesService.Devices
lastpointy[2] = -1;
xypointcount = 0;
}
catch (Exception ex) { Log.Info(ex.Message); }
finally { }
}
public static void GetTouchNumber(int number)
{
@ -83,25 +89,154 @@ namespace DevicesService.Devices
FiveInchDll.ComSetBackGroundAdv();
}
}
catch { }
catch (Exception ex) { Log.Info(ex.Message); }
finally { }
}
//0816加报点
public static void GetTouchPoint(TOUCH_INFO[] info1)
{ }
{
int x = 0, y = 0;
int pressurevl;
int dx = 0, dy = 0;
for (int k = 0; k < 80; k++)
{
x = info1[k].X;
y = info1[k].Y;
//落笔
if (info1[k].Pressure > 0)
{
if (info1[k].Pressure > 0 && info1[k].Pressure < 500)
{
pressurevl = 1;
pen.Width = 1;
}
else if (info1[k].Pressure >= 500 && info1[k].Pressure < 1000)
{
pressurevl = 2;
pen.Width = 2;
}
else if (info1[k].Pressure >= 1000 && info1[k].Pressure < 1500)
{
pressurevl = 3;
pen.Width = 3;
}
else if (info1[k].Pressure >= 1500 && info1[k].Pressure < 2048)
{
pressurevl = 4;
pen.Width = 4;
}
else
{
pressurevl = 0;
pen.Width = 1;
}
}
else
{
//抬笔
pressurevl = 0;
lastpointx[0] = -1;
lastpointy[0] = -1;
lastpointx[1] = -1;
lastpointy[1] = -1;
lastpointx[2] = -1;
lastpointy[2] = -1;
continue;
}
if (info1[k].Pressure > 10) //有画线宽度
{
lastpointx[2] = x;
lastpointy[2] = y;
if (lastpointx[2] != -1)
{
if (lastpointx[1] != -1 && lastpointx[0] != -1)
{
//float dx = Math.Abs(lastpointx[2] - beginPos.X);
//float dy = Math.Abs(endPos.Y - beginPos.Y);
dx = Math.Abs(lastpointx[2] - lastpointx[1]);
dy = Math.Abs(lastpointy[2] - lastpointy[1]);
if ((dx != 0) && (dy != 0))
{
if (lastpointy[1] != -1 && lastpointy[2] != -1) //y轴相同的点不画,直接跳过
{
if (lastpointx[1] != -1 && lastpointx[2] != -1) //第3个点和第二个点比较是否x坐标在同一个位置,不是就执行画第一个点到第二个点的线
{
//painter->drawLine(frontPos, beginPos); //画线
//g.DrawLine(pen, lastpointx[0], lastpointy[0], lastpointx[1], lastpointy[1]);
//painter->drawPoint(beginPos); //画点
//frontPos = beginPos;
//beginPos = endPos;
lastpointx[0] = lastpointx[1];
lastpointy[0] = lastpointy[1];
lastpointx[1] = lastpointx[2];
lastpointy[1] = lastpointy[2];
}
else
{
//是就执行画第一个点到第三个点的线
//painter->drawLine(frontPos, endPos);
//g.DrawLine(pen, lastpointx[0], lastpointy[0], lastpointx[2], lastpointy[2]);
//frontPos = endPos; //第三个点赋值第一个点
//beginPos = QPointF(0, 0); //第二个点置空
//beginPos.X = -1;
//beginPos.Y = -1;
lastpointx[0] = lastpointx[2];
lastpointy[0] = lastpointy[2];
lastpointx[1] = -1;
lastpointy[1] = -1;
}
}
}
}//
else
{
if (lastpointx[1] != -1) //不为空在赋值,防止丢弃点时赋空值
{
lastpointx[0] = lastpointx[1];
lastpointy[0] = lastpointy[1];
}
lastpointx[1] = lastpointx[2];
lastpointy[1] = lastpointy[2];
}
}
}
else
{
dx = dy = 0;
lastpointx[0] = -1;
lastpointy[0] = -1;
lastpointx[1] = -1;
lastpointy[1] = -1;
lastpointx[2] = -1;
lastpointy[2] = -1;
}
}
}
//打开签字版
public static int OpenComDevice()
{
int status = FiveInchDll.OpenComDevice(GetTouchNumber);
try
{
status = FiveInchDll.OpenComDevice(GetTouchNumber);
Console.WriteLine("OpenComDevice:" + status);
if (status == 0)
{
//2022-08-16 加实时报点
status = FiveInchDll.ComSendPoint(1, GetTouchPoint);
Console.WriteLine("ComSendPoint:" + status);
////2022-08-16 加实时报点
int ret = FiveInchDll.ComSendPoint(0, null);
//Console.WriteLine("ComSendPoint:" + ret);
if (true)
{
string UIFile = System.IO.Directory.GetCurrentDirectory() + "\\adv_ui.jpg";
@ -117,6 +252,55 @@ namespace DevicesService.Devices
Console.WriteLine("ComSetSignBackgroundImage:" + ret1);
}
}
//if (status == -1)
//{
// status = FiveInchDll.OpenComDevice(GetTouchNumber);
// Console.WriteLine("OpenComDevice:" + status);
// if (status == 0)
// {
// ////2022-08-16 加实时报点
// //int ret = FiveInchDll.ComSendPoint(1, GetTouchPoint);
// //Console.WriteLine("ComSendPoint:" + ret);
// if (true)
// {
// string UIFile = System.IO.Directory.GetCurrentDirectory() + "\\adv_ui.jpg";
// int ret1 = FiveInchDll.ComSendAdvantageImage(UIFile);
// Console.WriteLine("ComSendAdvantageImage:" + ret1);
// FiveInchDll.ComSetBackGroundAdv();
// }
// if (true)
// {
// string UIFile = System.IO.Directory.GetCurrentDirectory() + "\\sign_ui.jpg";
// int ret1 = FiveInchDll.ComSetSignBackgroundImage(UIFile);
// Console.WriteLine("ComSetSignBackgroundImage:" + ret1);
// }
// }
//}
//else if (status == 0)
//{
// ////2022-08-16 加实时报点
// //int ret = FiveInchDll.ComSendPoint(1, GetTouchPoint);
// //Console.WriteLine("ComSendPoint:" + ret);
// if (true)
// {
// string UIFile = System.IO.Directory.GetCurrentDirectory() + "\\adv_ui.jpg";
// int ret1 = FiveInchDll.ComSendAdvantageImage(UIFile);
// Console.WriteLine("ComSendAdvantageImage:" + ret1);
// FiveInchDll.ComSetBackGroundAdv();
// }
// if (true)
// {
// string UIFile = System.IO.Directory.GetCurrentDirectory() + "\\sign_ui.jpg";
// int ret1 = FiveInchDll.ComSetSignBackgroundImage(UIFile);
// Console.WriteLine("ComSetSignBackgroundImage:" + ret1);
// }
//}
}
catch(Exception ex) { Log.Info(ex.Message); }
finally { }
return status;
}
@ -124,6 +308,8 @@ namespace DevicesService.Devices
public static int CloseComDevice()
{
int ret = -1;
try
{
if (status == 0)
{
ret = FiveInchDll.CloseComDevice();
@ -132,6 +318,9 @@ namespace DevicesService.Devices
status = -1;
}
}
}
catch { }
finally { }
return ret;
}

8
DevicesService/DevicesService.csproj

@ -22,6 +22,14 @@
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<Optimize>True</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<None Remove="Commen\COMUtils.cs~RF189d1fe.TMP" />
</ItemGroup>

3
DevicesService/Program.cs

@ -46,7 +46,8 @@ namespace DevicesService
//启动Tcp服务
Task.Run(() =>
{
TcpServer.Start();
TcpServer tcp = new TcpServer();
tcp.Start();
});
while (true)
{

12
DevicesService/Properties/launchSettings.json

@ -0,0 +1,12 @@
{
"profiles": {
"WSL": {
"commandName": "WSL2",
"distributionName": ""
},
"DevicesService": {
"commandName": "Executable",
"executablePath": "D:\\Coder\\DevicesServiceIntern\\DevicesService\\bin\\x86\\Debug\\net6.0\\DevicesService.exe"
}
}
}
Loading…
Cancel
Save