, , - "" , , - . - -, , ( , , ).
.NET:
protected void Page_Load(object sender, EventArgs e)
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "image/jpeg";
using (Bitmap bmp =
(Bitmap)Bitmap.FromFile(
@"\\internal-photoserver\shared drive\bobsmith.jpg"))
{
bmp.Save(
HttpContext.Current.Response.OutputStream,
ImageFormat.Jpeg);
}
HttpContext.Current.Response.End();
}
using System.Drawing;
using System.Drawing.Imaging;
, , , ( ). - " ", , " ".
, . ASP.NET, , , .
: MSDN:
System.Drawing Windows ASP.NET. , .
( , , , , , ), plain-ol 'System.IO , , (- - ).
: , :
protected void Page_Load(object sender, EventArgs e)
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "image/jpeg";
byte[] bytes = File.ReadAllBytes(
@"\\internal-photoserver\shared drive\bobsmith.jpg");
HttpContext.Current.Response.OutputStream.Write(bytes, 0, bytes.Length);
HttpContext.Current.Response.End();
}
using System.IO;
, , , ( BMP). , , , , .
, , , - (, - - , - , MSDN System.Drawing ASP.NET).
: , , , , , , , HTML- (.. ..).
, , , , , IFRAME src, .
IFRAME - , . JPEG , , . , .
ASP.NET , , . ASP.NET , .