修改测试问题

master
mzhifa 7 months ago
parent 4f686ff5d0
commit 7dda496345

@ -88,9 +88,8 @@ namespace StartServerWPF.Modules.Main.ViewModels
}
catch (Exception ex)
{
MessageBox.Show("加载配置失败,"+path);
MessageBox.Show($"加载配置失败,路径:{path},错误:{ex}");
}
}
SetProperty(ref _wareaSelectedIndex, value);
}
@ -276,8 +275,8 @@ namespace StartServerWPF.Modules.Main.ViewModels
{
ApmsEventSource.Clear();
}
var fileName = Directory.GetFiles(SavePath, "*.index", SearchOption.AllDirectories);
var fileName = Directory.GetFiles(SavePath, "*.index", SearchOption.AllDirectories);
foreach (var file in fileName)
{
bool flag= DateTime.TryParseExact(Path.GetFileNameWithoutExtension(file), "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture,
@ -289,7 +288,6 @@ namespace StartServerWPF.Modules.Main.ViewModels
File.Delete(file);
}
}
}
Task.Run(() =>

@ -21,15 +21,11 @@ namespace StartServerWPF.Modules.Main
public Action<string> WebSocketMessageReceived;
public void WebSocketInit(string url)
{
Debug.WriteLine("客户端");
webSocket4Net = new WebSocket(url);
webSocket4Net.Opened += WebSocket4Net_Opened;
webSocket4Net.Error += new EventHandler<ErrorEventArgs>(WebSocket_Error);
webSocket4Net.MessageReceived += WebSocket4Net_MessageReceived;
Debug.WriteLine("客户端连接成功!");
// thread.Start();
}
private string name = string.Empty;
private string pwd = string.Empty;
@ -40,8 +36,6 @@ namespace StartServerWPF.Modules.Main
name = account;
pwd = password;
webSocket4Net.Open();
// string jsonstr= JsonSerializer.Serialize(new CSUserSigin { type = CSMessage.sigin, utype = "device", account=account,password=password});
// SendMes(jsonstr);
Task.Run(async () =>{
await Task.Delay(2000);
isHeartbeat = true;
@ -91,7 +85,7 @@ namespace StartServerWPF.Modules.Main
private void WebSocket4Net_Opened(object sender, EventArgs e)
{
Debug.WriteLine("连接websocket成功****************");
Debug.WriteLine("连接websocket成功,自动登录****************");
string jsonstr = JsonSerializer.Serialize(new CSUserSigin { type = CSMessage.sigin, utype = "device", account = name, password = pwd });
SendMes(jsonstr);
}

Loading…
Cancel
Save