profnami
یک شنبه 09 آبان 1389, 00:55 صبح
سلام من چطوری میتونم از داخل یه کلاس به Server.MapPath دسترسی داشته باشم ؟ کد ها رو ببینید :
public class Utility {
public Utility(){}
public static void SaveImage(int width,int height,string group,Stream filecontent) { System.Drawing.Image img = System.Drawing.Image.FromStream(filecontent); System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(img, width, height); bmp.Save("~/img/news/" + Guid.NewGuid().ToString() + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg); } }
public class Utility {
public Utility(){}
public static void SaveImage(int width,int height,string group,Stream filecontent) { System.Drawing.Image img = System.Drawing.Image.FromStream(filecontent); System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(img, width, height); bmp.Save("~/img/news/" + Guid.NewGuid().ToString() + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg); } }