private void Window_Closed(object sender, EventArgs e) { try { //if (localWebCam != null) //{ // if (localWebCam.IsRunning) // localWebCam.Stop(); //} if (disapthcerTimer != null) { disapthcerTimer.IsEnabled = false; } AnyChatCoreSDK.LeaveRoom(-1); AnyChatCoreSDK.Logout(); AnyChatCoreSDK.Release(); //if (_writer != null) // _writer.Close(); Main.videoCreat = null; } catch (Exception ex) { string strError = ex.ToString(); ErrorCollection.GetInstance().SetErrorInfo(strError); } }
//窗体关闭 private void Hall_FormClosed(object sender, FormClosedEventArgs e) { AnyChatCoreSDK.Logout(); AnyChatCoreSDK.Release(); Application.Exit(); bReleased = true; //Login loginForm = new Login(); //loginForm.Close(); }
//窗体关闭 private void Login_FormClosed(object sender, FormClosedEventArgs e) { try { AnyChatCoreSDK.Logout(); AnyChatCoreSDK.Release(); } catch (Exception ex) { Log.SetLog("QueueClient.Login.Login_FormClosed Login_FormClosed:" + ex.Message.ToString()); } }
//单击登录 private void btn_login_Click(object sender, EventArgs e) { //应用签名 string signStr = string.Empty; //签名时间戳 int signTimestamp = 0; try { if (tb_name.Text != "") { string addr = ""; int port = 8906; try { addr = tb_serveradd.Text; port = Convert.ToInt32(tb_port.Text); m_userName = tb_name.Text; } catch (Exception) { ShowMessage("配置有误"); } if (hallForm != null && !hallForm.bReleased) { AnyChatCoreSDK.Logout(); AnyChatCoreSDK.Release(); } SystemSetting.Init(this.Handle); /* AnyChat可以连接自主部署的服务器、也可以连接AnyChat视频云平台; * 连接自主部署服务器的地址为自设的服务器IP地址或域名、端口; * 连接AnyChat视频云平台的服务器地址为:cloud.anychat.cn;端口为:8906 */ AnyChatCoreSDK.Connect(addr, port); /* * AnyChat支持多种用户身份验证方式,包括更安全的签名登录, * 详情请参考:http://bbs.anychat.cn/forum.php?mod=viewthread&tid=2211&highlight=%C7%A9%C3%FB */ int ret = AnyChatCoreSDK.Login(m_userName, "123", 0);//登录系统 } else { ShowMessage("用户名不能为空"); } } catch (Exception ex) { Log.SetLog("VideoChat.Login.btn_login_Click btn_login_Click:" + ex.Message.ToString()); } }
//单击登录 private void btn_login_Click(object sender, EventArgs e) { try { if (cbox_userIdentity.Text != "") { string addr = ""; int port = 8906; try { addr = cbox_serverIP.Text; port = Convert.ToInt32(cbox_port.Text); m_userName = cbox_userName.Text; m_userIdentity = (UserIdentityType)cbox_userIdentity.SelectedIndex; m_identityPriority = Int32.Parse(cbox_identityPriority.Text); } catch (Exception) { ShowMessage("配置有误"); } if (hallForm != null && !hallForm.bReleased) { AnyChatCoreSDK.Logout(); AnyChatCoreSDK.Release(); } SystemSetting.Init(this.Handle); AnyChatCoreSDK.Connect(addr, port); } else { ShowMessage("用户名不能为空"); } } catch (Exception ex) { Log.SetLog("QueueClient.Login.btn_login_Click btn_login_Click:" + ex.Message.ToString()); ShowMessage(ex.Message.ToString()); } }
//单击登录 private void btn_login_Click(object sender, EventArgs e) { try { if (tb_name.Text != "") { string addr = ""; int port = 8906; try { addr = tb_serveradd.Text; port = Convert.ToInt32(tb_port.Text); m_userName = tb_name.Text; } catch (Exception) { ShowMessage("配置有误"); } if (hallForm != null && !hallForm.bReleased) { AnyChatCoreSDK.Logout(); AnyChatCoreSDK.Release(); } SystemSetting.Init(this.Handle); AnyChatCoreSDK.Connect(addr, port); } else { ShowMessage("用户名不能为空"); } } catch (Exception ex) { Log.SetLog("VideoChat.Login.btn_login_Click btn_login_Click:" + ex.Message.ToString()); } }
//退出释放资源 public static void Release(int myroomID) { AnyChatCoreSDK.LeaveRoom(myroomID); AnyChatCoreSDK.Logout(); AnyChatCoreSDK.Release(); }
//单击登录 private void btn_login_Click(object sender, EventArgs e) { try { if (cbox_userIdentity.Text != "") { string addr = ""; int port = 8906; try { addr = cbox_serverIP.Text; port = Convert.ToInt32(cbox_port.Text); m_userName = cbox_userName.Text; m_userIdentity = (UserIdentityType)cbox_userIdentity.SelectedIndex; m_identityPriority = Int32.Parse(cbox_identityPriority.Text); if (m_userIdentity == UserIdentityType.Agent) { if (cmbBox_Router.SelectedIndex == 1) { m_isAutoRouter = true; } else { m_isAutoRouter = false; } } } catch (Exception) { ShowMessage("配置有误"); } if (hallForm != null && !hallForm.bReleased) { AnyChatCoreSDK.Logout(); AnyChatCoreSDK.Release(); } SystemSetting.Init(this.Handle); /* AnyChat可以连接自主部署的服务器、也可以连接AnyChat视频云平台; * 连接自主部署服务器的地址为自设的服务器IP地址或域名、端口; * 连接AnyChat视频云平台的服务器地址为:cloud.anychat.cn;端口为:8906 */ AnyChatCoreSDK.Connect(addr, port); /* * AnyChat支持多种用户身份验证方式,包括更安全的签名登录, * 详情请参考:http://bbs.anychat.cn/forum.php?mod=viewthread&tid=2211&highlight=%C7%A9%C3%FB */ int ret = AnyChatCoreSDK.Login(m_userName, "123", 0);//登录系统 RecordLoginTrace(); } else { ShowMessage("用户名不能为空"); } } catch (Exception ex) { Log.SetLog("QueueClient.Login.btn_login_Click btn_login_Click:" + ex.Message.ToString()); ShowMessage(ex.Message.ToString()); } }
private void frmRoom_FormClosing(object sender, FormClosingEventArgs e) { AnyChatCoreSDK.LeaveRoom(m_RoomID); AnyChatCoreSDK.Logout(); System.Environment.Exit(0); }
// 关闭窗口时释放资源 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { AnyChatCoreSDK.LeaveRoom(-1); AnyChatCoreSDK.Logout(); AnyChatCoreSDK.Release(); }
//单击登录 private void btn_login_Click(object sender, EventArgs e) { try { if (cbox_userName.Text != "") { string addr = ""; int port = 8906; try { addr = cbox_serverIP.Text; port = Convert.ToInt32(cbox_port.Text); m_userName = cbox_userName.Text; m_userPassword = txt_password.Text; m_roomNumber = Int32.Parse(cbox_roomNumber.Text); } catch (Exception) { ShowMessage("输入的登录设置项有误,请检查!"); } if (RoomForm != null && !RoomForm.bReleased) { AnyChatCoreSDK.Logout(); AnyChatCoreSDK.Release(); } RecordLoginTrace(); ConnectInfo connInfo = new ConnectInfo(); connInfo.ServerIP = addr; connInfo.Port = port; connInfo.UserName = m_userName; connInfo.UserPassword = m_userPassword; connInfo.RoomID = m_roomNumber; connInfo.isOpenRemoteDesktop = checkBox_RemoteDesktop.Checked; connInfo.AppGuid = m_appGuid; RoomForm = null; //hallForm = new Hall(m_userId, cbox_userIdentity.Text); RoomForm = new frmRoom2(connInfo, this); RoomForm.Show(); this.Hide(); //if (RoomForm != null && !RoomForm.bReleased) //{ // AnyChatCoreSDK.Logout(); // AnyChatCoreSDK.Release(); //} //SystemSetting.Init(this.Handle); //AnyChatCoreSDK.Connect(addr, port); } else { ShowMessage("用户名不能为空"); } } catch (Exception ex) { Log.SetLog("AnyChatMultiCamera.Login.btn_login_Click btn_login_Click:" + ex.Message.ToString()); ShowMessage(ex.Message.ToString()); } }