Exemplo n.º 1
0
        /// <summary>
        /// 页面载入响应
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.ContentType = "application/x-msdownload";
            string filename = "attachment; filename=" + "ServerList_" + ServerListConfig.GetData(0).Name + ".zip";

            Response.AddHeader("Content-Disposition", filename);
            Response.BinaryWrite(CdnZip.PackServerList(Request.Params["version"]));
        }
        /// <summary>
        /// 修改按钮点击响应
        /// </summary>
        protected void modifyButton_Click(object sender, EventArgs e)
        {
            if (this.channelListBox.SelectedIndex < 0)
            {
                return;
            }

            ServerListConfigData data = ServerListConfig.GetData(this.channelListBox.SelectedIndex);

            this.UpdateData(data);
            ServerListConfig.Modify(this.channelListBox.SelectedIndex, data);
            this.channelListBox.Items[this.channelListBox.SelectedIndex].Text = data.Name;
        }