开发者

Would the following code make an http request to the server?

Would this code make a http request or 开发者_开发知识库is it just faking it?

var writer = TextWriter.Null;
var response = new HttpResponse(writer);
var request = new HttpRequest("DummyFile.aspx", HttpContext.Current.Request.Url.ToString(),
                              "__EVENTTARGET=true&__VIEWSTATEENCRYPTED=true");
var context = new HttpContext(request, response);

var page = new Page
               {
                   EnableViewStateMac = true,
                   ViewStateEncryptionMode = ViewStateEncryptionMode.Always
               };
page.ProcessRequest(context);


It is faking the presence of a HttpRequest. Nothing goes across the wire when executing this code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜