Exemplo n.º 1
0
        protected void BtnSend_Click(object sender, EventArgs e)
        {
            

            if (TBMsg.Text.Length > 30)
            {
                LbError.Text = "Melding skal maks ha 30 tegn";
                TBMsg.Text = String.Empty;
            }
            else if (string.IsNullOrWhiteSpace(TBMsg.Text))
            {
                LbError.Text = "Meldingen er tomt!";
                TBMsg.Text = String.Empty;
            }
            else
            {
                c = new TCP_Client();
                HttpCookie cookie = Request.Cookies["UserName"];

                TextBox chatText = TBMsg;
                string username = cookie["Name"];
                string chatInput = CheckIP();
                chatInput += "Chat=" + username + ": " + chatText.Text;
                chatText.Text = "";
                c.Send(chatInput);

                LbError.Text = String.Empty;
            }


        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            c = new TCP_Client();

            songList.Items.Clear();
            c.Send("Jukebox=Page Load");
            createList();


            if (HttpContext.Current.Request.Cookies["Voted"] != null)
            {
                HttpCookie cookie = Request.Cookies["Voted"];
                MultiView2.ActiveViewIndex = 1;
            }
            else
            {
                MultiView2.ActiveViewIndex = 0;
            }
        }