0

これを使用してバイトを読み取っていました

 string path = HttpContext.Current.Server.MapPath(Image1.ImageUrl);
 prsn.photo = File.ReadAllBytes(path);

しかし、バイト配列を読み取る方法

<asp:Image ID="Image1" ImageUrl="~/Site/images/agent.png" Height="80px" Width="60px" runat="server" />

image1.uriを取得しているときに画像をロードすると、パスが返されます

"~/getCaseImg.aspx?caseid=1"

しかし、今はこのパスからバイト配列を読み取っていません

string path = HttpContext.Current.Server.MapPath(Image1.ImageUrl);
prsn.photo = File.ReadAllBytes(path);
4

0 に答える 0