using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Manage_Update : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void checknew_Click(object sender, EventArgs e)
    {

    }
    protected void downnow_Click(object sender, EventArgs e)
    {

    }
    /*
     	protected void Page_Load(object sender, System.EventArgs e)
		{
			bmm.CheckUser(false);
			if (this.Request.QueryString["action"] == "down")
			{
				string filename = this.Request.QueryString["file"];
				WebClient wc = new WebClient();
				try
				{
					wc.DownloadFile("http://service.aspxer.com/updatefile/" + filename.Replace("\\", "/") + ".nb", var.now_apppath + filename.Replace("/", "\\"));
					wc.Dispose();
				}
				catch
				{
					wc.Dispose();
					this.Response.Write ("<script language=\"javascript\" type=\"text/javascript\">parent." + filename.Replace(".", "_").Replace("/", "__").Replace("\\", "__") + ".innerHTML = \"<b>×</b>\";</script>");
					this.Response.End();
				}
				StreamWriter sw = new StreamWriter (var.now_apppath + "bbslib\\Update.log", true, System.Text.Encoding.GetEncoding("gb2312"));
				sw.Write ("," + this.Request.QueryString["id"]);
				sw.Close();
				bmm.AddLog_Manage("NowBoard Update:更新文件" + filename);
				this.Response.Write ("<script language=\"javascript\" type=\"text/javascript\">parent." + filename.Replace(".", "_").Replace("/", "__").Replace("\\", "__") + ".innerHTML = \"<b>√</b>\";</script>");
				this.Response.End();
			}
			if (!this.Page.IsPostBack)
			{
				this.downnow.Visible = false;
				this.filelist.Visible = false;
			}
		}

		 

		protected void checknew_Click(object sender, System.EventArgs e)
		{
			string uped = "";
			if (File.Exists(var.now_apppath + "bbslib\\Update.log"))
			{
				StreamReader sr = new StreamReader(var.now_apppath + "bbslib\\Update.log", System.Text.Encoding.GetEncoding("gb2312"));
				uped = "0" + sr.ReadLine().Replace("\r", "").Replace("\n", "");
				sr.Close();
			}
			com.aspxer.service.UP cau = new com.aspxer.service.UP();
			DataSet ds = cau.GetUpFileList(int.Parse(var.ver.Replace(".", "0")), uped);
			this.filelist.Visible = true;
			this.filelist.DataSource = ds.Tables["uplist"].DefaultView;
			this.filelist.DataBind();
			this.checknew.Visible = false;
			this.downnow.Visible = true;
		}

		protected void downnow_Click(object sender, System.EventArgs e)
		{
			this.checknew.Visible = false;
			this.downnow.Visible = false;
			this.filelist.Visible = false;
			string tlist = this.Request.Form["c"];
			if (tlist == null || tlist == "")
			{
				this.Server.Transfer ("Info.aspx?v=err&msg=没有选择要升级的文件");
			}
			string[] tmplist = tlist.Split(',');
			string flist = "以下为当前下载进度。请不要刷新页面或者离开本页！<br /><br />";
			foreach (string tmpv in tmplist)
			{
				string[] tv = tmpv.Split('|');
				flist += "<br /><span id=\"" + tv[1].Replace(".", "_").Replace("/", "__").Replace("\\", "__") + "\">…</span>&nbsp;&nbsp;" + tv[1] + "<iframe style=\"display:none\" src=\"Update.aspx?action=down&id=" + tv[0] + "&file=" + tv[1] + "\"></iframe>";
			}
			this.downlist.Text = flist + "<br /><br />全部下载完毕后<a href=\"Update.aspx\"><b>点击此处返回</b></a>.<br />(如果更新了dll文件,论坛将被重新启动,管理员权限会丢失,需要重新登陆)<br /><br />显示为<b>…</b>的表示正在下载<br />显示为<b>√</b>的表示下载完毕<br />显示为<b>×</b>的表示下载失败)";
			//this.downlist.Text = this.Request.Form["c"].Trim().Replace(",", "<br />");
		}
     
     */
}
