使用 HttpResponse.Write 方法进行字符串串联
生活随笔
收集整理的這篇文章主要介紹了
使用 HttpResponse.Write 方法进行字符串串联
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
該方法提供非常有效的緩沖和連接服務(wù)。但是,如果您正在執(zhí)行廣泛的連接,請使用多個 Response.Write 調(diào)用。下面示例中顯示的技術(shù)比用對 Response.Write 方法的單個調(diào)用連接字符串更快。
[C#]
Response.Write("a");
Response.Write(myString);
Response.Write("b");
Response.Write(myObj.ToString());
Response.Write("c");
Response.Write(myString2);
Response.Write("d");
[Visual Basic]
Response.Write("a")
Response.Write(myString)
Response.Write("b")
Response.Write(myObj.ToString())
Response.Write("c")
Response.Write(myString2)
Response.Write("d")
[C#]
Response.Write("a");
Response.Write(myString);
Response.Write("b");
Response.Write(myObj.ToString());
Response.Write("c");
Response.Write(myString2);
Response.Write("d");
[Visual Basic]
Response.Write("a")
Response.Write(myString)
Response.Write("b")
Response.Write(myObj.ToString())
Response.Write("c")
Response.Write(myString2)
Response.Write("d")
總結(jié)
以上是生活随笔為你收集整理的使用 HttpResponse.Write 方法进行字符串串联的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 除非有特殊的原因要关闭缓冲,否则使其保持
- 下一篇: 不要依赖代码中的异常