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.
精彩评论