UI/aadmin/downloadupdate.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using System.IO;
public partial class admin_downloadupdate : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            _load();
        }
    }
    protected void _load()
    {
        Model.downlist md  = new Model.downlist();
        md.id = Convert.ToInt32(Request.QueryString["uid"]);
        BLL.downlist bd = new BLL.downlist();
        SqlDataReader sdr = bd.datareader(md);
        if (sdr.Read())
        {
            name.Text= sdr["_title"].ToString();
            size.Text = sdr["_size"].ToString();
            fileurl.Text = sdr["_uploadurl"].ToString();
            Label1.Text = sdr["_uploadurl"].ToString();
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (File.Exists(Server.MapPath("~/") + Label1.Text))
        {
            File.Delete(Server.MapPath("~/")+Label1.Text);
        }
        string filepath = FileUpload1.PostedFile.FileName;
        string type = filepath.Substring(filepath.LastIndexOf(".")+1);
        if (type == "doc" || type == "txt" || type == "xls" || type == "rar")
        {
            if (FileUpload1.PostedFile.ContentLength < 102400 * 1024)
            {
                string _size;
                string newfilename = "index_" + System.DateTime.Now.ToString("yyyyMMddhhmmssfff");
                FileUpload1.PostedFile.SaveAs(Server.MapPath("~/download/" + newfilename));
                fileurl.Text = "download/" + newfilename;
                _size = (FileUpload1.PostedFile.ContentLength / 1024.0).ToString() + "KB";
                size.Text = (FileUpload1.PostedFile.ContentLength / 1024).ToString() + ".";
                _size = _size.Substring(_size.LastIndexOf(".") + 1, 3);
                
                size.Text = size.Text + _size + "KB";
                Label1.Text = "上传成功";

            }
            else
后面还有 46 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。