关于上传。。拜托各位大侠拉。。。。。。。。。。
{
string path=Server.MapPath("Upcptp");
string y=DateTime.Now.Year.ToString();
string m=DateTime.Now.Month.ToString();
string d=DateTime.Now.Day.ToString();
string h=DateTime.Now.Hour.ToString();
string n=DateTime.Now.Minute.ToString();
string s=DateTime.Now.Second.ToString();
string filename=y+m+d+h+n+s;
Random r=new Random();
filename=filename+r.Next(1000);
filename=filename+"."+upload_file.PostedFile.FileName.Substring(upload_file.PostedFile.FileName.Length-3);
string FN="Upcptp/"+filename;
filename=path+"/"+filename;
upload_file.PostedFile.SaveAs(filename);
if (fileEXT=="gif")
{
Response.Write("<"+"script>window.parent.cp_edit.dlList__ct3_cptp.Text='"+FN+"'</"+"script>");
}
else if(fileEXT=="jpg")
{
Response.Write("<"+"script>window.parent.cp_edit.dlList__ct3_cptp.Text='"+FN+"'</"+"script>");
}
upload_file.Visible=false;
Button1.Visible=false;
Info.InnerHtml="成功上传一个文件点击 <a href=Upcptp.aspx>这儿</a> 继续上传";
Info.Visible=true;
}
else
{
Info.Visible=true;
}
}
我通过以上代码上传文件 为什么
if (fileEXT=="gif")
{
Response.Write("<"+"script>window.parent.cp_edit.dlList__ct3_cptp.Text='"+FN+"'</"+"script>");
}
else if(fileEXT=="jpg")
{
Response.Write("<"+"script>window.parent.cp_edit.dlList__ct3_cptp.Text='"+FN+"'</"+"script>");
}
这两句都没起作用。。。这样写是否有错呢?