Converting a JPEG image to a byte array - COM exception

后端 未结 4 2042
孤城傲影
孤城傲影 2020-12-29 23:47

Using C#, I\'m trying to load a JPEG file from disk and convert it to a byte array. So far, I have this code:

static void Main(string[] args)
{
    System.Wi         


        
4条回答
  •  情深已故
    2020-12-30 00:16

    Other suggestion:

    byte[] image = System.IO.File.ReadAllBytes ( Server.MapPath ( "noimage.png" ) );
    

    Should be working not only with images.

提交回复
热议问题