3、谁能罗列一下MIME属性的各种值。

解决方案 »

  1.   

    Response.Clear();
    Response.ClearHeaders();
    Response.Buffer = false;
    Response.ContentType = "application/octet-stream";
    Response.AppendHeader("Content-Disposition","attachment;filename=" +HttpUtility.UrlEncode(fi.FullName,System.Text.Encoding.UTF8));
    Response.AppendHeader("Content-Length",fi.Length.ToString());
    Response.WriteFile(fi.FullName);
    Response.Flush();
    Response.End();
      

  2.   

    Imports eOMPClass
    Imports System.Data
    Imports System.Data.SqlClient
    Public Class ElBullList
        Inherits System.Web.UI.Page
        Protected WithEvents lbSubject As System.Web.UI.WebControls.Label
        Protected WithEvents lbAuthor As System.Web.UI.WebControls.Label
        Protected WithEvents lbTime As System.Web.UI.WebControls.Label
        Protected WithEvents lbTypeName As System.Web.UI.WebControls.Label
        Protected WithEvents lbContent As System.Web.UI.WebControls.Label
        Protected WithEvents trAttach As System.Web.UI.HtmlControls.HtmlTableRow
        Protected WithEvents tdAttach As System.Web.UI.HtmlControls.HtmlTableCell
        Protected WithEvents tdHr As System.Web.UI.HtmlControls.HtmlTableCell
        Protected WithEvents ShowSpan As System.Web.UI.HtmlControls.HtmlGenericControl
        Dim sqlQry As New SqlQuerySimple()
        Dim UserChk As New AccessSecurity()
    #Region " Web Form Designer Generated Code "    'This call is required by the Web Form Designer.
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()    End Sub    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
            'CODEGEN: This method call is required by the Web Form Designer
            'Do not modify it using the code editor.
            InitializeComponent()
        End Sub#End Region    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'Put user code to initialize the page here
            On Error GoTo lbError        'UserChk.RightChk(, 139, , )
            Dim dsResult As New DataTable()
            Dim strSQL As String
            Dim sTitle As String
            Dim sContent As String
            Dim sDepartMent As String
            Dim sUserName As String
            Dim sDate As String
            Dim sElBullNo As String        If Trim(Request.QueryString("ElBullNo")) <> "" Then       '承接传来的公告号
                sElBullNo = Trim(Request.QueryString("ElBullNo"))
            End If        If Trim(Session("iUserId")) = "" Then
                Response.Redirect("../Warning.aspx")
                Exit Sub
            End If        strSQL = "delete from T_OMPPromptInfo where InfoTypeID='3' and InfoID='" + CStr(CInt(sElBullNo)) + "' and UserID='" + Trim(Session("iUserId")) + "'"
            sqlQry.InsUpdDelQry(strSQL)        strSQL = "select * from T_ElBulletin where ElBullNo='" + sElBullNo + "'"
            dsResult = sqlQry.Query(strSQL)    '取出该条公告内容        If dsResult.Rows.Count > 0 Then    '若该记录存在
                sTitle = Trim(dsResult.Rows(0).Item("ElBullTitle"))
                sContent = RTrim(dsResult.Rows(0).Item("ElBullContent"))
                sDate = Trim(dsResult.Rows(0).Item("ElBullDate"))
                sDepartMent = Trim(dsResult.Rows(0).Item("ElBullDept"))
            Else
                Response.Write("<script language='javascript'>")
                Response.Write("alert('对不起,该条公告不存在!');")
                Response.Write("window.close();")
                Response.Write("</script>")
                Exit Sub
            End If        lbSubject.Text = sTitle
            ShowSpan.InnerHtml = sContent
            'Response.Write(sContent)        'lbContent.Text = sContent
            lbTime.Text = sDate
            lbAuthor.Text = sDepartMent
            lbTypeName.Text = "电子公告"
            Call ShowAttachList(sElBullNo)        'Response.Write("<table border='0' cellpadding='0' cellspacing='0' align='center' width='80%'><tr><td height='25px'>&nbsp;</td></tr><table>")
            'Response.Write("<table border='1' cellpadding='0' cellspacing='0' align='center' width='80%' bordercolor='#6699CC'><tr><td>")
            'Response.Write("<table border='0' cellpadding='0' cellspacing='0' align='center'><tr><td colspan='8' height='10px' width='376px'>&nbsp;</td></tr>")
            'Response.Write("<tr><td colspan='8' align='center' class='Title'>" + sTitle + "</td></tr><tr><td colspan='8'>")
            'Call OutPutContent(sContent)    '按格式输出公告内容
            'Response.Write("</td></tr><tr><td colspan='6'>&nbsp;</td><td colspan='2' align='center'>" + sDepartMent + "</td></tr>")
            'Response.Write("<tr><td colspan='6'>&nbsp;</td><td colspan='2' align='center'>" + sDate + "</td></tr>")
            'Response.Write("<tr><td colspan='8' height='8px'>&nbsp;</td></tr></table></td></tr></table>")
            'Call ShowAttachList(sElBullNo)
            'Response.Write("<table border='0' cellpadding='0' cellspacing='0' width='80%' align='center'>")
            'Response.Write("<tr><td align=right><input type='button' class='btnRaise' style='width:68px;height:26px' value='关闭' onclick='return window.close()'>")
            'Response.Write("</td></tr></table>")
            Exit Sub
    lbError:
            Response.Write("<script language='javascript'>" + Chr(13) + "alert('系统发生意外错误,请重试或联系相关部门!')" + Chr(13) + "</script>")
        End Sub    Private Sub OutPutContent(ByVal sOutString As String)
            On Error GoTo lbError
            Dim sOutChar As String
            Dim iLoop As Integer
            Dim iBlank As Integer        For iLoop = 0 To sOutString.Length - 1
                sOutChar = Mid(sOutString, iLoop + 1, 1)   '取出当前字符            If Asc(sOutChar) = 32 Or Asc(sOutChar) = 13 Then
                    If Asc(sOutChar) = 32 Then     '若当前字符为空字符
                        Response.Write("&nbsp;")
                    End If                If Asc(sOutChar) = 13 Then     '若当前字符为换行字符
                        Response.Write("<br>")
                    End If
                Else
                    Response.Write(sOutChar)       '输出字符
                End If
            Next
            Exit Sub
    lbError:
            Response.Write("<script language='javascript'>" + Chr(13) + "alert('系统发生意外错误,请重试或联系相关部门!')" + Chr(13) + "</script>")
        End Sub    Private Sub ShowAttachList(ByVal sBullNo As String)
            On Error GoTo lbError
            Dim strSQL As String
            Dim dsResult As New DataTable()
            Dim iLoop As Integer        strSQL = "select ElBullNo,ElFileName,ElAttachNo,ElFileType from T_ElBullEncls where ElBullNo='" + sBullNo + "'"
            dsResult = sqlQry.Query(strSQL)        If dsResult.Rows.Count < 1 Then
                Exit Sub
            Else
                Me.tdHr.InnerHtml = "<hr style='color:red'>"
            End If        For iLoop = 0 To dsResult.Rows.Count - 1
                Dim MyCell As New HtmlTableCell()
                Dim MyLabel As New Web.UI.WebControls.Label()
                'MyLabel.Text = "<a Target='Blank' href='ElReadAttach.aspx?ElBullNo=" + sBullNo + "&AttachNo=" + Trim(dsResult.Rows(iLoop).Item("ElAttachNo")) + "'>附件" + CStr(iLoop + 1) + ":" + Trim(dsResult.Rows(iLoop).Item("ElFileName")) + "</a><br>"
                MyLabel.Text = "<a Target='Blank' href='../../Include/ReadAttach.asp?FileName=" + Trim(dsResult.Rows(iLoop).Item("ElFileName")) + "&FileType=" + Trim(dsResult.Rows(iLoop).Item("ElFileType")) + "&ElBullNo=" + sBullNo + "&AttachID=" + Trim(dsResult.Rows(iLoop).Item("ElAttachNo")) + "&QueryFlag=2'>" + Trim(dsResult.Rows(iLoop).Item("ElFileName")) + "</a><br>"
                MyCell = tdAttach
                MyCell.Controls.Add(MyLabel)
            Next
            Exit Sub
    lbError:
            Response.Write("<script language='javascript'>" + Chr(13) + "alert('系统发生意外错误,请重试或联系相关部门!')" + Chr(13) + "</script>")
        End Sub
    End Class
      

  3.   

    ZHANG9652(剑神独孤求败) ( ) ???
      

  4.   

    谁能罗列一下MIME属性的各种值你搜一下注册表就可以了,你总会知道一个值吧,所有的值在注册表中都存在一起,找到一个就找到所有的了
      

  5.   

    MIME属性值
    http://www.duke.edu/websrv/file-extensions.html
      

  6.   

    Response.AppendHeader("Content-Disposition","inline;filename=" +HttpUtility.UrlEncode(fi.FullName,System.Text.Encoding.UTF8));