1.html代码
<form id="form1" action="TestYield" method="post" enctype="multipart/form-data">
<div> <input type="text" id="title" name="title"/>
<input type="file" id="file" name="file"/> <input type="submit" value="提交" />
</div>
</form>
2.后台接收代码
HttpFileCollection hfc = Context.Request.Files; if (Request["title"] != null)
{
Response.Write(Request["title"]);
}
if (hfc.Count>)
{
HttpPostedFile hf = Context.Request.Files["file"]; Response.Write(hf.FileName);
}
else
{
Response.Write("is null");
}
return;