⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 paperreview.aspx.cs

📁 学术会议在线投稿系统 fghgfhgfhgfhfgh
💻 CS
字号:
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;
using System.IO;

public partial class ViewPage_PaperReview : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        int ArticleId = Convert.ToInt32(Session["ArticleId"].ToString());
        PaperOp select_paper = new PaperOp();

        DataTable dt = new DataTable();
        dt = select_paper.select_paperinformation_dynamic(ArticleId);
        if (dt.Rows.Count == 0)
        {
            Response.Redirect("~/ViewPage/LoginError.aspx");
        }
        else
        {
            foreach (DataRow dr in dt.Rows)
            {
                TableRow tr = new TableRow();
                for (int j = 0; j < dt.Columns.Count - 1; j++)
                {
                    switch (j)
                    {
                        case 0:
                            Writerlab.Text= dr[0].ToString();
                            break;
                        case 1:
                            Subjectlab.Text = dr[1].ToString();
                            break;
                        case 2:
                           Disciplinelab.Text = dr[2].ToString();
                            break;
                        case 3:
                            Abstracttb.Text= dr[3].ToString();
                            break;
                        case 4:
                            String temp = dr[4].ToString();
                            Keywordlab1.Text= temp;
                            break;


                    }

                }

            }
        }
        //PaperOp update_paperstatic = new PaperOp();
        //update_paperstatic.update_articlestatic_experts(ArticleId);

    }
    protected void Downloadbtn_Click(object sender, EventArgs e)
    {
        int ArticleId = Convert.ToInt32(Session["ArticleId"].ToString());
        GetArticleUrl getarticleurl = new GetArticleUrl();
        String filepath = getarticleurl.getarticleurl(ArticleId);
        System.IO.Stream iStream = null;

        // Buffer to read 10K bytes in chunk:
        byte[] buffer = new Byte[10000];

        // Length of the file:
        Int32 length;

        // Total bytes to read:
       long dataToRead;
        // Identify the file to download including its path.
        //  string filepath = "DownloadFileName";

        // Identify the file name.
        String filename = System.IO.Path.GetFileName(filepath);

        try
        {
            // Open the file.
            iStream = new System.IO.FileStream(filepath, System.IO.FileMode.Open,
                        System.IO.FileAccess.Read, System.IO.FileShare.Read);


            // Total bytes to read:
            dataToRead = iStream.Length;

            Response.ContentType = "application/octet-stream";
            Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);

            // Read the bytes.
            while (dataToRead > 0)
            {
                // Verify that the client is connected.
                if (Response.IsClientConnected)
                {
                    // Read the data in buffer.
                    length = iStream.Read(buffer, 0, 10000);

                    // Write the data to the current output stream.
                    Response.OutputStream.Write(buffer, 0, length);

                    // Flush the data to the HTML output.
                    Response.Flush();

                    buffer = new Byte[10000];
                    dataToRead = dataToRead - length;
                }
                else
                {
                    //prevent infinite loop if user disconnects
                    dataToRead = -1;
                }
            }
        }
        catch (Exception ex)
        {
            // Trap the error, if any
            ex.ToString();
            Server.Transfer("~/ViewPage/LoginError.aspx");
        }
        finally
        {
            if (iStream != null)
            {
                //Close the file.
                iStream.Close();
            }
        }
  
     
    }
    protected void Continuebtn_Click(object sender, EventArgs e)
    {
        Server.Transfer("~/ViewPage/PaperReview_2.aspx");
    }
    protected void Backbtn_Click(object sender, EventArgs e)
    {
        Server.Transfer("~/ViewPage/PaperList_ReviewNewPaper_Experts.aspx");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -