Home > Net >  Addgoods
Addgoods

Time:09-26

Public string imgUpLoad (FileUpload fUpload)
{
The string fileName="";
If (fUpload. HasFile)
{
String fileExt=Path. GetExtension (fUpload. The FileName). ToLower ();
String uploadFileExt=". GIF |. JPG. | PNG |. BMP ";
If ((+ uploadFileExt + "|" "|"). The IndexOf ((+ fileExt + "|" "|")) & gt; 0)
{
Try
{
FileName=DateTime. Now. ToString (" fsadfsadfasdgfsdagsda "). The ToString () + fileExt;
FUpload. SaveAs (Server. MapPath (" Images/Goods ") + fileName);
}
The catch (Exception ee)
{
ClientScript. RegisterStartupScript (GetType (), ", "
"<script> Alert (' + ee. Message +) & lt;/script>" );
}}
The else {
ClientScript. RegisterStartupScript (GetType (), ", "
"<script> Alert (" please upload the GIF | JPG | PNG | BMP file ') & lt;/script>" );
}
}
}

CodePudding user response:

What are you trying to say?

CodePudding user response:

bumingjueli
  • Related