ImageResizer 당신이 원하는 모든 것을 줄 것이다 :
http://imageresizing.net/
string fileExt = System.IO.Path.GetExtension(imageUpload.FileName);
if (string.Equals(fileExt, ".jpg", StringComparison.OrdinalIgnoreCase))
{
foreach (string fileKey in HttpContext.Current.Request.Files.Keys)
{
HttpPostedFile file = HttpContext.Current.Request.Files[fileKey];
if (file.ContentLength <= 0) continue; //Skip unused file controls.
try
{
ImageJob i = new ImageJob(file, "~/eventimages/<guid>_<filename:A-Za-z0-9>.<ext>",
new ResizeSettings("width=60&height=60&format=jpg&crop=auto"));
i.Build();
ImageJob j = new ImageJob(file, "~/eventimages/<guid>_<filename:A-Za-z0-9>.<ext>",
new ResizeSettings("width=250&height=250&format=jpg&crop=auto"));
j.Build();
string sitePath = MapPath(@"~");
thumbImagePath = i.FinalPath.Replace(sitePath, "~\\");
mainImagePath = j.FinalPath.Replace(sitePath, "~\\");
}
catch
{
// Had to swallow the exception here:
// http://stackoverflow.com/questions/7533845/system-argumentexception-parameter-is-not-valid
}
}
}
내가 당신 VB에게 제공 할 수 있습니다 내 ASP.NET 서버에서 실행되는 .NET 버전. 변환 할 수 있습니까? –
왜 ASP.NET 프로젝트에 외부 DLL로 C# 코드를 사용하지 않습니까? 그냥 필요한 기능을 호출 ... – Mortalus
당신은 제게 VB 버전을 보내 주시겠습니까. 나는 그것을 줄 것이다. – Pacobart