网上学生作业管理系统


里面有详细的源代码,可以直接在电脑上运行
资源截图
代码片段和文件信息
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
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.xml.Linq;
using System.Data.SqlClient;
using System.Data;

using System.IO;
public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender EventArgs e)
    {

    }

    /// 
    /// 上传文件方法
    /// 

    /// 获取上传文件路径
    protected string uploadFile()
    {

        string fileUrl = ““;
        if (this.fuFile.HasFile)
        {
            //存储路径
            string strFilePath = System.Web.HttpContext.Current.Server.MapPath(“uploadfile\“);
            //string strFilePath = “~//uploadfile//“;
            //判断文件夹是否存在
            if (!Directory.Exists(strFilePath))
            {
                //文件夹不存在,创建文件夹
                Directory.CreateDirectory(strFilePath);
            }
            //上传大小单位M 
            string strFileExt = “100“;
            int strFileSize = Convert.ToInt32(strFileExt) * 1024 * 1024;
            //用这一行代码获得扩展名时,会多加一个点,比如.png,所以要把这个点去掉
            string newExt = Path.GetExtension(this.fuFile.FileName).Replace(“.“ ““);
            try
            {
                //检查文件大小
                if (this.fuFile.PostedFile.ContentLength > strFileSize)
                {
                    Response.Write(“ript>alert(‘上传文件大小超过限制!‘)ript>“);
                    return fileUrl;
                }
                //检查文件类型PostedFile.ContentType进行检查,确保不能上传asp之类的木马
                string allowFileMIME = “pptaviwmvdocdocxpptxpdfrarzipmp3flv“;
                if (allowFileMIME.IndexOf(newExt) == -1)
                {
                    Response.Write(“ript>alert(‘您只能传送doc/ppt/wmv/avi/docx/pptx/rar/zip/mp3类型文件!‘);ript>“);
                    return fileUrl;
                }
                //按当前时间重命名文件,以免上传同名文件   
                System.DateTime dt = DateTime.Now;
                string newName = dt.Year.ToString();
                newName += dt.Month.ToString();
                newName += dt.Day.ToString();
                newName += dt.Hour.ToString();
                newName += dt.Minute.ToString();
                newName += dt.Second.ToString();
                newName += “.“;
                newName += newExt;
                this.fuFile.SaveAs(strFilePath + newName);
                fileUrl = newName;

                return fileUrl;
            }
            catch (Exception ex)
            {
                Response.Write(“ript>alert(‘文件上传失败!‘)ript>“);
                return fileUrl;
            }
        }
        else
        {
            Response.Write(“ript>alert(‘您还没有选择上传的文件或上传文件的内容为空!‘)ript>“);
            return fileUrl;
        }
    }


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    3437807  2012-02-21 15:05  022ASP.NET学生作业管理系统录像录像.exe

     文件       8659  2012-04-19 16:59  022ASP.NET学生作业管理系统程序App_CodeCommon.cs

     文件       3901  2012-04-19 16:59  022ASP.NET学生作业管理系统程序App_CodeCookieHelper.cs

     文件       3791  2012-04-19 16:59  022ASP.NET学生作业管理系统程序App_CodeCutString.cs

     文件       6959  2012-05-13 11:10  022ASP.NET学生作业管理系统程序App_CodeDB.cs

     文件       6210  2012-04-19 16:59  022ASP.NET学生作业管理系统程序App_CodeEncryptHelper.cs

     文件       7409  2012-04-19 16:59  022ASP.NET学生作业管理系统程序App_CodejavascriptHelper.cs

     文件    3145728  2012-05-13 14:59  022ASP.NET学生作业管理系统程序App_DataDataDB.mdf

     文件     110592  2012-04-19 16:59  022ASP.NET学生作业管理系统程序BinAspNetPager.dll

     文件         74  2012-04-19 16:59  022ASP.NET学生作业管理系统程序BinAspNetPager.dll.refresh

     文件      36864  2012-04-19 16:59  022ASP.NET学生作业管理系统程序BinFredCK.FCKeditorV2.dll

     文件        144  2012-04-19 16:59  022ASP.NET学生作业管理系统程序BinFredCK.FCKeditorV2.dll.refresh

     文件      73728  2012-04-19 16:59  022ASP.NET学生作业管理系统程序BinVincent.AutoAuthCode.dll

     文件        106  2012-04-19 16:59  022ASP.NET学生作业管理系统程序BinVincent.AutoAuthCode.dll.refresh

     文件       3802  2012-04-19 16:59  022ASP.NET学生作业管理系统程序uzhi.aspx

     文件       4549  2012-04-19 16:59  022ASP.NET学生作业管理系统程序uzhi.aspx.cs

     文件       9339  2012-04-19 16:59  022ASP.NET学生作业管理系统程序Com_AdminAdd_HuiYuan.aspx

     文件       1737  2012-04-19 16:59  022ASP.NET学生作业管理系统程序Com_AdminAdd_HuiYuan.aspx.cs

     文件        539  2012-04-19 16:59  022ASP.NET学生作业管理系统程序Com_Admincsscss.css

     文件       1302  2012-04-19 16:59  022ASP.NET学生作业管理系统程序Com_AdmincssFlashPic.css

     文件        701  2012-04-19 16:59  022ASP.NET学生作业管理系统程序Com_Admincssgrid.css

     文件        158  2012-04-19 16:59  022ASP.NET学生作业管理系统程序Com_Admincsslogin.css

     文件       3091  2012-04-19 16:59  022ASP.NET学生作业管理系统程序Com_Admincssstyle.css

     文件       1689  2012-04-19 16:59  022ASP.NET学生作业管理系统程序Com_Admincssstyle_left.css

     文件        341  2012-04-19 16:59  022ASP.NET学生作业管理系统程序Com_Adminimages11.gif

     文件        215  2012-04-19 16:59  022ASP.NET学生作业管理系统程序Com_Adminimages22.gif

     文件        337  2012-04-19 16:59  022ASP.NET学生作业管理系统程序Com_Adminimages33.gif

     文件       1849  2012-04-19 16:59  022ASP.NET学生作业管理系统程序Com_Adminimagesajax-loader.gif

     文件        306  2012-04-19 16:59  022ASP.NET学生作业管理系统程序Com_Adminimagesack_jt.gif

     文件        273  2012-04-19 16:59  022ASP.NET学生作业管理系统程序Com_Adminimagesg.gif

............此处省略671个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)