調用HttpHanlder的幾種返回方式小結_jquery
來源:懂視網
責編:小采
時間:2020-11-27 21:17:24
調用HttpHanlder的幾種返回方式小結_jquery
調用HttpHanlder的幾種返回方式小結_jquery:1:如果只需要返回字符串形式的 例如內容、JSON字符串數組等 context.Response.Write(resultPrice.ToString()); 2:如要要返回圖片,那么采用流的形式 bitmap.Save(context.Response.OutputStream, System.Drawing.Im
導讀調用HttpHanlder的幾種返回方式小結_jquery:1:如果只需要返回字符串形式的 例如內容、JSON字符串數組等 context.Response.Write(resultPrice.ToString()); 2:如要要返回圖片,那么采用流的形式 bitmap.Save(context.Response.OutputStream, System.Drawing.Im

1:如果只需要返回字符串形式的 例如內容、JSON字符串數組等
context.Response.Write(resultPrice.ToString());
2:如要要返回圖片,那么采用流的形式
bitmap.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
3:如果返回文件,例如txt文檔提供給客戶端下載
context.Response.WriteFile("文本實例.txt");
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
調用HttpHanlder的幾種返回方式小結_jquery
調用HttpHanlder的幾種返回方式小結_jquery:1:如果只需要返回字符串形式的 例如內容、JSON字符串數組等 context.Response.Write(resultPrice.ToString()); 2:如要要返回圖片,那么采用流的形式 bitmap.Save(context.Response.OutputStream, System.Drawing.Im