private void cmdUpFile_Click(object sender, System.EventArgs e)
{
lblErr.Visible = false;
Bitmap empPic;
try
{
empPic = new Bitmap( File1.PostedFile.InputStream );
}
catch
{
lblErr.Text = "错误文件格式,请重试!!";
lblErr.Visible = true;
return;
} lnkPic.Src = File1.PostedFile.FileName;
cmdOK.Visible = true;
} private void cmdOK_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
if ( this.EmpRightCode >= 3 )
{
Bitmap empPic;
try
{
empPic = new Bitmap(lnkPic.Src);
}
catch(Exception ex)
{
lblErr.Text = ex.ToString();
lblErr.Visible = true;
return;
} Bitmap picSmall = new Bitmap( empPic,110,130 );
MemoryStream stream = new MemoryStream();
picSmall.Save( stream,System.Drawing.Imaging.ImageFormat.Jpeg );
byte[] byteArray = stream.ToArray(); int empID = Convert.ToInt16( lblEmpID.Text,10 );
MrBaseInf PhotoAccess = new MrBaseInf();
PhotoAccess.UpdateEmpPic( empID,byteArray );
Response.Redirect("empbase.aspx?empid="+lblEmpID.Text,false);
}
else
{
JScript.Alert("您没有权限进行此操作!");
}
}
为什么运行后,会提示无效的参数,请大虾们帮帮忙,小人不胜感激!!~
{
lblErr.Visible = false;
Bitmap empPic;
try
{
empPic = new Bitmap( File1.PostedFile.InputStream );
}
catch
{
lblErr.Text = "错误文件格式,请重试!!";
lblErr.Visible = true;
return;
} lnkPic.Src = File1.PostedFile.FileName;
cmdOK.Visible = true;
} private void cmdOK_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
if ( this.EmpRightCode >= 3 )
{
Bitmap empPic;
try
{
empPic = new Bitmap(lnkPic.Src);
}
catch(Exception ex)
{
lblErr.Text = ex.ToString();
lblErr.Visible = true;
return;
} Bitmap picSmall = new Bitmap( empPic,110,130 );
MemoryStream stream = new MemoryStream();
picSmall.Save( stream,System.Drawing.Imaging.ImageFormat.Jpeg );
byte[] byteArray = stream.ToArray(); int empID = Convert.ToInt16( lblEmpID.Text,10 );
MrBaseInf PhotoAccess = new MrBaseInf();
PhotoAccess.UpdateEmpPic( empID,byteArray );
Response.Redirect("empbase.aspx?empid="+lblEmpID.Text,false);
}
else
{
JScript.Alert("您没有权限进行此操作!");
}
}
为什么运行后,会提示无效的参数,请大虾们帮帮忙,小人不胜感激!!~
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货