Chat.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using System.Data.OleDb;
  12. using PowerTalkBox;
  13. public partial class PowerChatRoom_Chat : System.Web.UI.Page
  14. {
  15.     public string uidstr = "";
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.         LoginLogic.MatchLoad("../", "PowerChatRoom_Chat");
  19.         
  20.        object objuid=Request.QueryString["uid"];     
  21.        if (objuid != null)
  22.        {
  23.            uidstr = objuid.ToString();
  24.        }
  25.         if (!IsPostBack)
  26.         {
  27.             try
  28.             {
  29.                 if(PowerTalkBox.PowerTalk.ExistUser(Server.HtmlEncode(SessionInclude.SessionId)))
  30.                 {
  31.                     PowerTalkBox.PowerTalk.DeleteUserInfo(Server.HtmlEncode(SessionInclude.SessionId));
  32.                 }
  33.                 PowerTalkBox1.MyUserName = Server.HtmlEncode(SessionInclude.SessionId);
  34.                 PowerTalkBox1.OutLocation = "../../MyDeskTop/MyPrompt.aspx";//过期后到评论的页面
  35.                 PowerTalkBox1.UserChangeList = "";//不提示任何消息
  36.                 PowerTalkBox1.InitLoad(); //初始化PowerTalkBox
  37.             }
  38.             catch { }
  39.         }
  40.       
  41.     }
  42.     /// <summary>
  43.     /// 退出的脚本
  44.     /// </summary>
  45.     public string OutScript
  46.     {
  47.         get {
  48.             return @"
  49. <script type=""text/javascript"">       
  50. <!--         
  51.      window.onbeforeunload = onbeforeunload_handler;       
  52.      window.onunload = onunload_handler;       
  53.      function onbeforeunload_handler(){  
  54.      document.getElementById('PowerTalkImg').src='LoginOut.aspx?uid=" + uidstr + @"';
  55.       var warning=""感谢您的咨询,欢迎您下次光临!"";  
  56.       alert(warning);             
  57.       //return warning;    
  58.      }       
  59.            
  60.      function onunload_handler(){   
  61.        
  62.          //var warning=""谢谢光临"";       
  63.          //alert(warning);       
  64.      }     
  65. // -->    
  66.   </script>";
  67.         }
  68.     
  69.     }
  70.   
  71. }