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

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