xuesheng/jianliManage.aspx.cs

(开头部分) 3KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.IO;

public partial class xuesheng_jianliManage : System.Web.UI.Page
{
    public string jianli = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        string sql;
        sql = "select * from jianli where xuehao='" + Session["UserName"].ToString().Trim()+"'";
        DataSet ds = sqlconn.dataquery(sql);
        if (ds.Tables[0].Rows.Count>0)
        {
            jianli = ds.Tables[0].Rows[0]["jianli"].ToString();

        }
    }
    protected void btnAdd_Click(object sender, ImageClickEventArgs e)
    {
      
        string xuehao = Session["UserName"].ToString();
        string image = this.File1.PostedFile.FileName;
        image = image.Substring(image.LastIndexOf("\\") + 1);
        string strsql = "delete from jianli where xuehao='"+xuehao+"' Insert into  jianli(xuehao,jianli)values('"+xuehao+"','"+image+"')";
        int n = sqlconn.exucutesql(strsql);
        if (n > 0)
        {
            File1.PostedFile.SaveAs(Server.MapPath("jianli\\" + image));
            Response.Write("<script language=javascript>alert('上传成功!');location='Default.aspx'</script>");

        }
        else
        {
            Response.Write("<script>javascript:alert('上传失败!');</script>");
            return;
        }

    }
    /// <summary>
    /// word转成html
    /// </summary>
    /// <param name="wordFileName"></param>
    private string WordToHtml(object wordFileName)
    {
        //在此处放置用户代码以初始化页面
        Microsoft.Office.Interop.Word.ApplicationClass word = new Microsoft.Office.Interop.Word.ApplicationClass();
        Type wordType = word.GetType();
        Microsoft.Office.Interop.Word.Documents docs = word.Documents;
        //打开文件
        Type docsType = docs.GetType();
        Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)docsType.InvokeMember("Open", System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { wordFileName, true, true });
        //转换格式,另存为
        Type docType = doc.GetType();
        string wordSaveFileName = wordFileName.ToString();
后面还有 26 行代码,购买后查看完整代码

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

AI 解读 AI

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

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