E:\sql\dc21Soution\dcsite\DayWork\Notice\NoticeFile\系统详细设计方案2.doc
页面显示这个。我想只显示 系统详细设计方案2.doc
要怎么做吗?后台戒指赋值的。
lbfile.Text = con_notice[NoticeData.CON_NOTICE_ADDFILEPATH].ToString();
页面显示这个。我想只显示 系统详细设计方案2.doc
要怎么做吗?后台戒指赋值的。
lbfile.Text = con_notice[NoticeData.CON_NOTICE_ADDFILEPATH].ToString();
string path = "E:\sql\dc21Soution\dcsite\DayWork\Notice\NoticeFile\系统详细设计方案2.doc";
string filename= path.Substring(path.LastIndexOf("\\")+1);
Response.Write(filename);
string path = @"E:\sql\dc21Soution\dcsite\DayWork\Notice\NoticeFile\系统详细设计方案2.doc";
string filename = path.Substring(path.LastIndexOf("\\") + 1);
lbfile.Text = filename;
public partial class PZ07_djb : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string bmh, destFileName;
bmh = Session["bmh"].ToString();
string path;
path = System.Configuration.ConfigurationSettings.AppSettings["DjbPath"]; destFileName = path + bmh.Substring(4, 4) + "\\" + bmh + ".gif";
destFileName = Server.UrlDecode(destFileName);
if (File.Exists(destFileName))
{
FileInfo fi = new FileInfo(destFileName);
Response.Clear();
Response.ClearHeaders();
Response.Buffer = false; Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(Path.GetFileName(destFileName), System.Text.Encoding.UTF8));
Response.AppendHeader("Content-Length", fi.Length.ToString());
Response.ContentType = "image/gif";
Response.WriteFile(destFileName);
Response.Flush();
Response.End();
}
else
{
Response.Write("<script langauge=javascript>alert('登记表文件不存在!');history.go(-1);</script>");
Response.End();
} }
}