|
|
|
@ -35,14 +35,15 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
SAEA.WebSocket.WSServer ws = new SAEA.WebSocket.WSServer(19983); |
|
|
|
|
ws.OnConnected += (s) => |
|
|
|
|
{ |
|
|
|
|
lit.Add(s.ToString()); |
|
|
|
|
string result = "{\"keycode\":\"" + "" + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"连接成功\"}"; |
|
|
|
|
byte[] bytes = SerializeContent(result); |
|
|
|
|
ws.Reply(s.ToString(), new SAEA.WebSocket.Model.WSProtocal(SAEA.WebSocket.Type.WSProtocalType.Text, bytes)); |
|
|
|
|
Log.Error("请求连接" + s.ToString()); |
|
|
|
|
}; |
|
|
|
|
ws.OnMessage += (s, e) => |
|
|
|
|
{ |
|
|
|
|
string content = Encoding.UTF8.GetString(e.Content); |
|
|
|
|
Log.Error("收到请求:" + s.ToString() + " 请求参数:" + content); |
|
|
|
|
//读取参数 |
|
|
|
|
if (content != "ping" && !string.IsNullOrEmpty(content)) |
|
|
|
|
{ |
|
|
|
@ -149,6 +150,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
{ |
|
|
|
|
result = "{\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"无效指令\"}"; |
|
|
|
|
} |
|
|
|
|
Log.Error("答复请求者:" + s.ToString() + " 返回数据:" + result); |
|
|
|
|
//答复请求者(处理完请求后在些答复) |
|
|
|
|
byte[] bytes = SerializeContent(result); |
|
|
|
|
ws.Reply(s.ToString(), new SAEA.WebSocket.Model.WSProtocal(SAEA.WebSocket.Type.WSProtocalType.Text, bytes)); |
|
|
|
@ -171,7 +173,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
lit.RemoveAll(n => n == s); |
|
|
|
|
Log.Error("断开连接" + s.ToString()); |
|
|
|
|
} |
|
|
|
|
catch { } |
|
|
|
|
finally { } |
|
|
|
@ -664,18 +666,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
DateTime dateTime = DateTime.Now; |
|
|
|
|
string time = DateTime.Now.ToString( |
|
|
|
|
"yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
|
|
|
|
string dirpath = System.IO.Directory.GetCurrentDirectory(); |
|
|
|
|
string[] array = dirpath.Split("/"); |
|
|
|
|
var groupCount = array.GroupBy(x => x).Select(group => new { Element = group.Key, Count = group.Count() }).Where(x => x.Count > 0); |
|
|
|
|
if (groupCount.Count() == 1) |
|
|
|
|
{ |
|
|
|
|
dirpath = dirpath + "/aks"; |
|
|
|
|
} |
|
|
|
|
else if (groupCount.Count() == 0) |
|
|
|
|
{ |
|
|
|
|
dirpath = dirpath + "/aks/aks"; |
|
|
|
|
} |
|
|
|
|
dirpath = dirpath + @"/wwwroot/PrintFile"; |
|
|
|
|
string dirpath = Utils.getSystemPaht() + @"/wwwroot/PrintFile"; |
|
|
|
|
if (!Directory.Exists(dirpath)) |
|
|
|
|
{ |
|
|
|
|
Directory.CreateDirectory(dirpath); |
|
|
|
@ -734,18 +725,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
DateTime dateTime = DateTime.Now; |
|
|
|
|
string time = DateTime.Now.ToString( |
|
|
|
|
"yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
|
|
|
|
string dirpath = System.IO.Directory.GetCurrentDirectory(); |
|
|
|
|
string[] array = dirpath.Split("/"); |
|
|
|
|
var groupCount = array.GroupBy(x => x).Select(group => new { Element = group.Key, Count = group.Count() }).Where(x => x.Count > 0); |
|
|
|
|
if (groupCount.Count() == 1) |
|
|
|
|
{ |
|
|
|
|
dirpath = dirpath + "/aks"; |
|
|
|
|
} |
|
|
|
|
else if (groupCount.Count() == 0) |
|
|
|
|
{ |
|
|
|
|
dirpath = dirpath + "/aks/aks"; |
|
|
|
|
} |
|
|
|
|
dirpath = dirpath + @"/wwwroot/PrintFile"; |
|
|
|
|
string dirpath = Utils.getSystemPaht() + @"/wwwroot/PrintFile"; |
|
|
|
|
if (!Directory.Exists(dirpath)) |
|
|
|
|
{ |
|
|
|
|
Directory.CreateDirectory(dirpath); |
|
|
|
@ -832,18 +812,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
DateTime dateTime = DateTime.Now; |
|
|
|
|
string time = DateTime.Now.ToString( |
|
|
|
|
"yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
|
|
|
|
string dirpath = System.IO.Directory.GetCurrentDirectory(); |
|
|
|
|
string[] array = dirpath.Split("/"); |
|
|
|
|
var groupCount = array.GroupBy(x => x).Select(group => new { Element = group.Key, Count = group.Count() }).Where(x => x.Count > 0); |
|
|
|
|
if (groupCount.Count() == 1) |
|
|
|
|
{ |
|
|
|
|
dirpath = dirpath + "/aks"; |
|
|
|
|
} |
|
|
|
|
else if (groupCount.Count() == 0) |
|
|
|
|
{ |
|
|
|
|
dirpath = dirpath + "/aks/aks"; |
|
|
|
|
} |
|
|
|
|
dirpath = dirpath + @"/wwwroot/WaveOutFile"; |
|
|
|
|
string dirpath = Utils.getSystemPaht() + @"/wwwroot/WaveOutFile"; |
|
|
|
|
if (!Directory.Exists(dirpath)) |
|
|
|
|
{ |
|
|
|
|
Directory.CreateDirectory(dirpath); |
|
|
|
@ -1288,18 +1257,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
} |
|
|
|
|
string time = DateTime.Now.ToString( |
|
|
|
|
"yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
|
|
|
|
string dirpath = System.IO.Directory.GetCurrentDirectory(); |
|
|
|
|
string[] array = dirpath.Split("/"); |
|
|
|
|
var groupCount = array.GroupBy(x => x).Select(group => new { Element = group.Key, Count = group.Count() }).Where(x => x.Count > 0); |
|
|
|
|
if (groupCount.Count() == 1) |
|
|
|
|
{ |
|
|
|
|
dirpath = dirpath + "/aks"; |
|
|
|
|
} |
|
|
|
|
else if (groupCount.Count() == 0) |
|
|
|
|
{ |
|
|
|
|
dirpath = dirpath + "/aks/aks"; |
|
|
|
|
} |
|
|
|
|
dirpath = dirpath + @"/wwwroot/Record"; |
|
|
|
|
string dirpath = Utils.getSystemPaht() + @"/wwwroot/Record"; |
|
|
|
|
if (!Directory.Exists(dirpath)) |
|
|
|
|
{ |
|
|
|
|
Directory.CreateDirectory(dirpath); |
|
|
|
@ -1394,18 +1352,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
|
|
|
|
|
{ |
|
|
|
|
string time = DateTime.Now.ToString( |
|
|
|
|
"yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); |
|
|
|
|
string dirpath = System.IO.Directory.GetCurrentDirectory(); |
|
|
|
|
string[] array = dirpath.Split("/"); |
|
|
|
|
var groupCount = array.GroupBy(x => x).Select(group => new { Element = group.Key, Count = group.Count() }).Where(x => x.Count > 0); |
|
|
|
|
if (groupCount.Count() == 1) |
|
|
|
|
{ |
|
|
|
|
dirpath = dirpath + "/aks"; |
|
|
|
|
} |
|
|
|
|
else if (groupCount.Count() == 0) |
|
|
|
|
{ |
|
|
|
|
dirpath = dirpath + "/aks/aks"; |
|
|
|
|
} |
|
|
|
|
dirpath = dirpath + @"/wwwroot/WavFile"; |
|
|
|
|
string dirpath = Utils.getSystemPaht() + @"/wwwroot/WavFile"; |
|
|
|
|
// Log.Info(dirpath); |
|
|
|
|
if (!Directory.Exists(dirpath)) |
|
|
|
|
{ |
|
|
|
|