/// <summary> /// 清理所有正在使用的资源。 /// </summary> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> protected override void Dispose(bool disposing) { //紧急存储数据 UserServer.ServerSettings.SaveToFile(); UserServer.ServerAccounts.SaveToFile(); Chats_Managment.SaveToFile(); if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }
private void Net_socket_server_ClientOnline(AsyncStateOne object1) { //上线后回发一条数据初始化信息 JObject json = new JObject { { "Time", new JValue(DateTime.Now) }, { "FileCount", new JValue(net_simple_file_server.File_Count()) }, { "chats", new JValue(Chats_Managment.ToSaveString()) } }; //发送客户端的初始化数据 net_socket_server.Send(object1, CommonHeadCode.MultiNetHeadCode.初始化数据, json.ToString()); //触发上下线功能 Net_socket_clients_change(DateTime.Now.ToString("MM-dd HH:mm:ss ") + object1._IpEnd_Point.Address.ToString() + ":" + object1.LoginAlias + " 上线"); }