日期:2014-05-17 浏览次数:20786 次
byte[] b = ImgToByt(Image.FromFile(fullPath));
[WebMethod]
public object UpdateFile(byte[] content, string extended)
{
//重命名图片的名称与路径 保存到F盘下的DC文件夹
string pn = string.Format(@"F:\DC\{0}.{1}", DateTime.Now.ToString("yyyyMMddHHmmss"), extended);
//File.WriteAllBytes(Server.MapPath(pathandname), content);
//File.WriteAllBytes(pn, content);
MemoryStream ms=new MemoryStream(content);
FileStream fs=new FileStream(pn,FileMode.Create);
ms.WriteTo(fs);
ms.Close();
fs.Close();
return content.Length;
}